### "What I Like About You: Legislator Personality and Legislator Approval"
### By Jonathan D. Klingler, Gary E. Hollibaugh, Jr., and Adam J. Ramey
### All analyses conducted using RStudio Version 1.0.143 and the following version of R:
##### R version 3.4.0 (2017-04-21) -- "You Stupid Darkness"
##### Copyright (C) 2017 The R Foundation for Statistical Computing
##### Platform: x86_64-apple-darwin15.6.0 (64-bit)

# Note that this code assumes you are in the working directory with all files.

rm(list=ls())
library(foreign)
library(games)
library(ggplot2)
library(lmtest)
library(texreg)
library(Zelig)
library(ZeligChoice)
library(grid)
library(ordinal)
library(basicspace)
library(RecordLinkage)
library(mvtnorm)
library(rockchalk)
library(plyr)
library(dplyr)
library(magrittr)
library(FactoMineR)
library(gtools)
library(fuzzyjoin)
library(stringdist)
library(wCorr)
library(optimx)
library(nloptr)

# Create subdirectories in case they don't exist.
# These subdirectories hold all results.
if(!dir.exists("Tables")){
  dir.create("Tables")
}
if(!dir.exists("Figures")){
  dir.create("Figures")
}
if(!dir.exists("Models")){
  dir.create("Models")
}

# set mlm optimizer
defaultControl <- list(algorithm="NLOPT_LN_BOBYQA",xtol_rel=1e-6,maxeval=1e5)

nloptwrap2 <- function(fn,par,lower,upper,control=list(),...) {
  for (n in names(defaultControl)) 
    if (is.null(control[[n]])) control[[n]] <- defaultControl[[n]]
    res <- nloptr(x0=par,eval_f=fn,lb=lower,ub=upper,opts=control,...)
    with(res,list(par=solution,
                  fval=objective,
                  feval=iterations,
                  conv=if (status>0) 0 else status,
                  message=message))
}

# Load all the data
cces_14rlb <- suppressWarnings(read.spss("CCES14_NYU_OUTPUT_Feb2015.sav", 
                                         use.value.labels = TRUE, 
                                         to.data.frame = TRUE, 
                                         use.missings = FALSE))
cces_14 <-  read.dta("CCES14_Common_Content_Validated.dta")

cces_16rlb <- suppressWarnings(read.spss("CCES16_HKR_OUTPUT_Feb2017.sav"))
cces_16 <- suppressWarnings(read.spss("CCES16_Common_OUTPUT_Feb2017.sav"))


### self-TIPI scores
cces_14rlb$self_openn <- (as.numeric(cces_14rlb$NYA337) + (8-as.numeric(cces_14rlb$NYA342)))/2
cces_14rlb$self_consc <- (as.numeric(cces_14rlb$NYA335) + (8-as.numeric(cces_14rlb$NYA340)))/2
cces_14rlb$self_extra <- (as.numeric(cces_14rlb$NYA333) + (8-as.numeric(cces_14rlb$NYA338)))/2
cces_14rlb$self_agree <- (as.numeric(cces_14rlb$NYA339) + (8-as.numeric(cces_14rlb$NYA334)))/2
cces_14rlb$self_neuro <- (as.numeric(cces_14rlb$NYA336) + (8-as.numeric(cces_14rlb$NYA341)))/2
cces_14rlb$self_emoti <- 8 - cces_14rlb$self_neuro

cces_16rlb$self_openn <- (as.numeric(cces_16rlb$HKR105) + (8-as.numeric(cces_16rlb$HKR110)))/2
cces_16rlb$self_consc <- (as.numeric(cces_16rlb$HKR103) + (8-as.numeric(cces_16rlb$HKR108)))/2
cces_16rlb$self_extra <- (as.numeric(cces_16rlb$HKR101) + (8-as.numeric(cces_16rlb$HKR106)))/2
cces_16rlb$self_agree <- (as.numeric(cces_16rlb$HKR107) + (8-as.numeric(cces_16rlb$HKR102)))/2
cces_16rlb$self_neuro <- (as.numeric(cces_16rlb$HKR104) + (8-as.numeric(cces_16rlb$HKR109)))/2
cces_16rlb$self_emoti <- 8 - cces_16rlb$self_neuro


### representative TIPI scores
cces_14rlb$rep_openn <- (as.numeric(cces_14rlb$NYA347) + (8-as.numeric(cces_14rlb$NYA352)))/2
cces_14rlb$rep_consc <- (as.numeric(cces_14rlb$NYA345) + (8-as.numeric(cces_14rlb$NYA350)))/2
cces_14rlb$rep_extra <- (as.numeric(cces_14rlb$NYA343) + (8-as.numeric(cces_14rlb$NYA348)))/2
cces_14rlb$rep_agree <- (as.numeric(cces_14rlb$NYA349) + (8-as.numeric(cces_14rlb$NYA344)))/2
cces_14rlb$rep_neuro <- (as.numeric(cces_14rlb$NYA346) + (8-as.numeric(cces_14rlb$NYA351)))/2
cces_14rlb$rep_emoti <- 8 - cces_14rlb$rep_neuro

cces_16rlb$rep_openn <- (as.numeric(cces_16rlb$HKR005) + (8-as.numeric(cces_16rlb$HKR010)))/2
cces_16rlb$rep_consc <- (as.numeric(cces_16rlb$HKR003) + (8-as.numeric(cces_16rlb$HKR008)))/2
cces_16rlb$rep_extra <- (as.numeric(cces_16rlb$HKR001) + (8-as.numeric(cces_16rlb$HKR006)))/2
cces_16rlb$rep_agree <- (as.numeric(cces_16rlb$HKR007) + (8-as.numeric(cces_16rlb$HKR002)))/2
cces_16rlb$rep_neuro <- (as.numeric(cces_16rlb$HKR004) + (8-as.numeric(cces_16rlb$HKR009)))/2
cces_16rlb$rep_emoti <- 8 - cces_16rlb$rep_neuro


### senator 1 tipi scores
cces_14rlb$sen1_openn <- (as.numeric(cces_14rlb$NYU357) + (8-as.numeric(cces_14rlb$NYU362)))/2
cces_14rlb$sen1_consc <- (as.numeric(cces_14rlb$NYU355) + (8-as.numeric(cces_14rlb$NYU360)))/2
cces_14rlb$sen1_extra <- (as.numeric(cces_14rlb$NYU353) + (8-as.numeric(cces_14rlb$NYU358)))/2
cces_14rlb$sen1_agree <- (as.numeric(cces_14rlb$NYU359) + (8-as.numeric(cces_14rlb$NYU354)))/2
cces_14rlb$sen1_neuro <- (as.numeric(cces_14rlb$NYU356) + (8-as.numeric(cces_14rlb$NYU361)))/2
cces_14rlb$sen1_emoti <- 8 - cces_14rlb$sen1_neuro

cces_16rlb$sen1_openn <- (as.numeric(cces_16rlb$HKR015) + (8-as.numeric(cces_16rlb$HKR020)))/2
cces_16rlb$sen1_consc <- (as.numeric(cces_16rlb$HKR013) + (8-as.numeric(cces_16rlb$HKR018)))/2
cces_16rlb$sen1_extra <- (as.numeric(cces_16rlb$HKR011) + (8-as.numeric(cces_16rlb$HKR016)))/2
cces_16rlb$sen1_agree <- (as.numeric(cces_16rlb$HKR017) + (8-as.numeric(cces_16rlb$HKR012)))/2
cces_16rlb$sen1_neuro <- (as.numeric(cces_16rlb$HKR014) + (8-as.numeric(cces_16rlb$HKR019)))/2
cces_16rlb$sen1_emoti <- 8 - cces_16rlb$sen1_neuro


### senator 2 tipi scores
cces_14rlb$sen2_openn <- (as.numeric(cces_14rlb$NYU407) + (8-as.numeric(cces_14rlb$NYU412)))/2
cces_14rlb$sen2_consc <- (as.numeric(cces_14rlb$NYU405) + (8-as.numeric(cces_14rlb$NYU410)))/2
cces_14rlb$sen2_extra <- (as.numeric(cces_14rlb$NYU403) + (8-as.numeric(cces_14rlb$NYU408)))/2
cces_14rlb$sen2_agree <- (as.numeric(cces_14rlb$NYU409) + (8-as.numeric(cces_14rlb$NYU404)))/2
cces_14rlb$sen2_neuro <- (as.numeric(cces_14rlb$NYU406) + (8-as.numeric(cces_14rlb$NYU411)))/2
cces_14rlb$sen2_emoti <- 8 - cces_14rlb$sen2_neuro

cces_16rlb$sen2_openn <- (as.numeric(cces_16rlb$HKR025) + (8-as.numeric(cces_16rlb$HKR030)))/2
cces_16rlb$sen2_consc <- (as.numeric(cces_16rlb$HKR023) + (8-as.numeric(cces_16rlb$HKR028)))/2
cces_16rlb$sen2_extra <- (as.numeric(cces_16rlb$HKR021) + (8-as.numeric(cces_16rlb$HKR026)))/2
cces_16rlb$sen2_agree <- (as.numeric(cces_16rlb$HKR027) + (8-as.numeric(cces_16rlb$HKR022)))/2
cces_16rlb$sen2_neuro <- (as.numeric(cces_16rlb$HKR024) + (8-as.numeric(cces_16rlb$HKR029)))/2
cces_16rlb$sen2_emoti <- 8 - cces_16rlb$sen2_neuro


### obama tipi scores (not on 2014 cces)
cces_14rlb$obama_openn <- NA
cces_14rlb$obama_consc <- NA
cces_14rlb$obama_extra <- NA
cces_14rlb$obama_agree <- NA
cces_14rlb$obama_neuro <- NA
cces_14rlb$obama_emoti <- NA

cces_16rlb$obama_openn <- (as.numeric(cces_16rlb$HKR035) + (8-as.numeric(cces_16rlb$HKR040)))/2
cces_16rlb$obama_consc <- (as.numeric(cces_16rlb$HKR033) + (8-as.numeric(cces_16rlb$HKR038)))/2
cces_16rlb$obama_extra <- (as.numeric(cces_16rlb$HKR031) + (8-as.numeric(cces_16rlb$HKR036)))/2
cces_16rlb$obama_agree <- (as.numeric(cces_16rlb$HKR037) + (8-as.numeric(cces_16rlb$HKR032)))/2
cces_16rlb$obama_neuro <- (as.numeric(cces_16rlb$HKR034) + (8-as.numeric(cces_16rlb$HKR039)))/2
cces_16rlb$obama_emoti <- 8 - cces_16rlb$obama_neuro


### get info for party recall questions
# first need to recode party labels to remove whitespace
# and to match DFL with Democratic Party
cces_14$CurrentGovParty <- gsub("[[:space:]]*$","", as.character(cces_14$CurrentGovParty), perl=T)
cces_14$CurrentGovParty[which(cces_14$CurrentGovParty == "Democratic-Farmer-Labor")] <- "Democratic"
cces_16$CurrentGovParty <- gsub("[[:space:]]*$","", as.character(cces_16$CurrentGovParty), perl=T)
cces_16$CurrentGovParty[which(cces_16$CurrentGovParty == "Democratic-Farmer-Labor")] <- "Democratic"

cces_14$CurrentSen1Party <- gsub("[[:space:]]*$","", as.character(cces_14$CurrentSen1Party), perl=T)
cces_14$CurrentSen1Party[which(cces_14$CurrentSen1Party == "Democratic-Farmer-Labor")] <- "Democratic"
cces_16$CurrentSen1Party <- gsub("[[:space:]]*$","", as.character(cces_16$CurrentSen1Party), perl=T)
cces_16$CurrentSen1Party[which(cces_16$CurrentSen1Party == "Democratic-Farmer-Labor")] <- "Democratic"

cces_14$CurrentSen2Party <- gsub("[[:space:]]*$","", as.character(cces_14$CurrentSen2Party), perl=T)
cces_14$CurrentSen2Party[which(cces_14$CurrentSen2Party == "Democratic-Farmer-Labor")] <- "Democratic"
cces_16$CurrentSen2Party <- gsub("[[:space:]]*$","", as.character(cces_16$CurrentSen2Party), perl=T)
cces_16$CurrentSen2Party[which(cces_16$CurrentSen2Party == "Democratic-Farmer-Labor")] <- "Democratic"

cces_14$CurrentHouseParty <- gsub("[[:space:]]*$","", as.character(cces_14$CurrentHouseParty), perl=T)
cces_14$CurrentHouseParty[which(cces_14$CurrentHouseParty == "Democratic-Farmer-Labor")] <- "Democratic"
cces_16$CurrentHouseParty <- gsub("[[:space:]]*$","", as.character(cces_16$CurrentHouseParty), perl=T)
cces_16$CurrentHouseParty[which(cces_16$CurrentHouseParty == "Democratic-Farmer-Labor")] <- "Democratic"


### party recall questions --- right/wrong/DK
# governor
cces_14$gov_right <- as.numeric((cces_14$CC14_310a == "Republican" & cces_14$CurrentGovParty == "Republican") |
                                  (cces_14$CC14_310a == "Democrat" & cces_14$CurrentGovParty == "Democratic") | 
                                  (cces_14$CC14_310a == "Other Party / Independent" 
                                   & cces_14$CurrentGovParty == "Independent"))
cces_14$gov_right[is.na(cces_14$gov_right)] <- 0
cces_14$gov_wrong <- as.numeric((cces_14$CC14_310a %in% c("Democrat", "Other Party / Independent") 
                                 & cces_14$CurrentGovParty == "Republican") |
                                  (cces_14$CC14_310a %in% c("Republican", "Other Party / Independent")  
                                   & cces_14$CurrentGovParty == "Democratic") | 
                                  (cces_14$CC14_310a %in% c("Republican", "Democrat")
                                   & cces_14$CurrentGovParty == "Independent"))
cces_14$gov_wrong[is.na(cces_14$gov_wrong)] <- 0
cces_14$gov_DK <- as.numeric(cces_14$CC14_310a %in% c("Never Heard of Person", "Not sure"))
cces_14$gov_DK[is.na(cces_14$gov_DK)] <- 0

cces_16$gov_right <- as.numeric((cces_16$CC16_322a == "Republican" & cces_16$CurrentGovParty == "Republican") |
                                  (cces_16$CC16_322a == "Democrat" & cces_16$CurrentGovParty == "Democratic") | 
                                  (cces_16$CC16_322a == "Other Party / Independent" 
                                   & cces_16$CurrentGovParty == "Independent"))
cces_16$gov_wrong <- as.numeric((cces_16$CC16_322a %in% c("Democrat", "Other Party / Independent") 
                                 & cces_16$CurrentGovParty == "Republican") |
                                  (cces_16$CC16_322a %in% c("Republican", "Other Party / Independent") 
                                   & cces_16$CurrentGovParty == "Democratic") |
                                  (cces_16$CC16_322a %in% c("Republican", "Democrat") 
                                   & cces_16$CurrentGovParty == "Independent"))
cces_16$gov_DK <- as.numeric(cces_16$CC16_322a %in% c("Never Heard of Person", "Not sure"))

# senator 1
cces_14$sen1_right <- as.numeric((cces_14$CC14_310b == "Republican" & cces_14$CurrentSen1Party == "Republican") |
                                  (cces_14$CC14_310b == "Democrat" & cces_14$CurrentSen1Party == "Democratic") | 
                                  (cces_14$CC14_310b == "Other Party / Independent" 
                                   & cces_14$CurrentSen1Party == "Independent"))
cces_14$sen1_right[is.na(cces_14$sen1_right)] <- 0
cces_14$sen1_wrong <- as.numeric((cces_14$CC14_310b %in% c("Democrat", "Other Party / Independent") 
                                 & cces_14$CurrentSen1Party == "Republican") |
                                  (cces_14$CC14_310b %in% c("Republican", "Other Party / Independent")  
                                   & cces_14$CurrentSen1Party == "Democratic") | 
                                  (cces_14$CC14_310b %in% c("Republican", "Democrat")
                                   & cces_14$CurrentSen1Party == "Independent"))
cces_14$sen1_wrong[is.na(cces_14$sen1_wrong)] <- 0
cces_14$sen1_DK <- as.numeric(cces_14$CC14_310b %in% c("Never Heard of Person", "Not sure"))
cces_14$sen1_DK[is.na(cces_14$sen1_DK)] <- 0

cces_16$sen1_right <- as.numeric((cces_16$CC16_322b == "Republican" & cces_16$CurrentSen1Party == "Republican") |
                                  (cces_16$CC16_322b == "Democrat" & cces_16$CurrentSen1Party == "Democratic") | 
                                  (cces_16$CC16_322b == "Other Party / Independent" 
                                   & cces_16$CurrentSen1Party == "Independent"))
cces_16$sen1_wrong <- as.numeric((cces_16$CC16_322b %in% c("Democrat", "Other Party / Independent") 
                                 & cces_16$CurrentSen1Party == "Republican") |
                                  (cces_16$CC16_322b %in% c("Republican", "Other Party / Independent") 
                                   & cces_16$CurrentSen1Party == "Democratic") |
                                  (cces_16$CC16_322b %in% c("Republican", "Democrat") 
                                   & cces_16$CurrentSen1Party == "Independent"))
cces_16$sen1_DK <- as.numeric(cces_16$CC16_322b %in% c("Never Heard of Person", "Not sure"))

# senator 2
cces_14$sen2_right <- as.numeric((cces_14$CC14_310c == "Republican" & cces_14$CurrentSen2Party == "Republican") |
                                   (cces_14$CC14_310c == "Democrat" & cces_14$CurrentSen2Party == "Democratic") | 
                                   (cces_14$CC14_310c == "Other Party / Independent" 
                                    & cces_14$CurrentSen2Party == "Independent"))
cces_14$sen2_right[is.na(cces_14$sen2_right)] <- 0
cces_14$sen2_wrong <- as.numeric((cces_14$CC14_310c %in% c("Democrat", "Other Party / Independent") 
                                  & cces_14$CurrentSen2Party == "Republican") |
                                   (cces_14$CC14_310c %in% c("Republican", "Other Party / Independent")  
                                    & cces_14$CurrentSen2Party == "Democratic") | 
                                   (cces_14$CC14_310c %in% c("Republican", "Democrat")
                                    & cces_14$CurrentSen2Party == "Independent"))
cces_14$sen2_wrong[is.na(cces_14$sen2_wrong)] <- 0
cces_14$sen2_DK <- as.numeric(cces_14$CC14_310c %in% c("Never Heard of Person", "Not sure"))
cces_14$sen2_DK[is.na(cces_14$sen2_DK)] <- 0

cces_16$sen2_right <- as.numeric((cces_16$CC16_322c == "Republican" & cces_16$CurrentSen2Party == "Republican") |
                                   (cces_16$CC16_322c == "Democrat" & cces_16$CurrentSen2Party == "Democratic") | 
                                   (cces_16$CC16_322c == "Other Party / Independent" 
                                    & cces_16$CurrentSen2Party == "Independent"))
cces_16$sen2_wrong <- as.numeric((cces_16$CC16_322c %in% c("Democrat", "Other Party / Independent") 
                                  & cces_16$CurrentSen2Party == "Republican") |
                                   (cces_16$CC16_322c %in% c("Republican", "Other Party / Independent") 
                                    & cces_16$CurrentSen2Party == "Democratic") |
                                   (cces_16$CC16_322c %in% c("Republican", "Democrat") 
                                    & cces_16$CurrentSen2Party == "Independent"))
cces_16$sen2_DK <- as.numeric(cces_16$CC16_322c %in% c("Never Heard of Person", "Not sure"))

# representative
cces_14$rep_right <- as.numeric((cces_14$CC14_310d == "Republican" & cces_14$CurrentHouseParty == "Republican") |
                                   (cces_14$CC14_310d == "Democrat" & cces_14$CurrentHouseParty == "Democratic") | 
                                   (cces_14$CC14_310d == "Other Party / Independent" 
                                    & cces_14$CurrentHouseParty == "Independent"))
cces_14$rep_right[is.na(cces_14$rep_right)] <- 0
cces_14$rep_wrong <- as.numeric((cces_14$CC14_310d %in% c("Democrat", "Other Party / Independent") 
                                  & cces_14$CurrentHouseParty == "Republican") |
                                   (cces_14$CC14_310d %in% c("Republican", "Other Party / Independent")  
                                    & cces_14$CurrentHouseParty == "Democratic") | 
                                   (cces_14$CC14_310d %in% c("Republican", "Democrat")
                                    & cces_14$CurrentHouseParty == "Independent"))
cces_14$rep_wrong[is.na(cces_14$rep_wrong)] <- 0
cces_14$rep_DK <- as.numeric(cces_14$CC14_310d %in% c("Never Heard of Person", "Not sure"))
cces_14$rep_DK[is.na(cces_14$rep_DK)] <- 0

cces_16$rep_right <- as.numeric((cces_16$CC16_322d == "Republican" & cces_16$CurrentHouseParty == "Republican") |
                                   (cces_16$CC16_322d == "Democrat" & cces_16$CurrentHouseParty == "Democratic") | 
                                   (cces_16$CC16_322d == "Other Party / Independent" 
                                    & cces_16$CurrentHouseParty == "Independent"))
cces_16$rep_wrong <- as.numeric((cces_16$CC16_322d %in% c("Democrat", "Other Party / Independent") 
                                  & cces_16$CurrentHouseParty == "Republican") |
                                   (cces_16$CC16_322d %in% c("Republican", "Other Party / Independent") 
                                    & cces_16$CurrentHouseParty == "Democratic") |
                                   (cces_16$CC16_322d %in% c("Republican", "Democrat") 
                                    & cces_16$CurrentHouseParty == "Independent"))
cces_16$rep_DK <- as.numeric(cces_16$CC16_322d %in% c("Never Heard of Person", "Not sure"))


## combine the party recall responses into data frames
cces_14_info <- subset(as.data.frame(cces_14), select = c(gov_right, gov_wrong, gov_DK,
                                                          sen1_right, sen1_wrong, sen1_DK,
                                                          sen2_right, sen2_wrong, sen2_DK,
                                                          rep_right, rep_wrong, rep_DK))

cces_16_info <- subset(as.data.frame(cces_16), select = c(gov_right, gov_wrong, gov_DK,
                                                          sen1_right, sen1_wrong, sen1_DK,
                                                          sen2_right, sen2_wrong, sen2_DK,
                                                          rep_right, rep_wrong, rep_DK))

## perform correspondence analysis and extract first dimension 
## normalize first dimension to make more info --> bigger values
cces_14_CA <- cces_14_info[-which(apply(cces_14_info,1,sum) == 0),]
cces_14_CA <- CA(cces_14_CA, graph = FALSE)
cces_14$CA_info <- NA
cces_14$CA_info[which(apply(cces_14_info,1,sum) != 0)] <- -cces_14_CA$row$coord[,1]

cces_16_CA <- cces_16_info[-which(apply(cces_16_info,1,sum) == 0),]
cces_16_CA <- CA(cces_16_CA, graph = FALSE)
cces_16$CA_info <- NA
cces_16$CA_info[which(apply(cces_16_info,1,sum) != 0)] <- -cces_16_CA$row$coord[,1]


### subset the data for later analysis, since we know which variables from the 
### common content we're using
cces_14rlb <- subset(cces_14rlb, select = c(V101, 
                                            self_openn, self_consc, self_extra, 
                                            self_agree, self_neuro, self_emoti,
                                            obama_openn, obama_consc, obama_extra, 
                                            obama_agree, obama_neuro, obama_emoti,
                                            rep_openn, rep_consc, rep_extra, 
                                            rep_agree, rep_neuro, rep_emoti,
                                            sen1_openn, sen1_consc, sen1_extra, 
                                            sen1_agree, sen1_neuro, sen1_emoti,
                                            sen2_openn, sen2_consc, sen2_extra, 
                                            sen2_agree, sen2_neuro, sen2_emoti))

cces_16rlb <- as.data.frame(cces_16rlb)
cces_16rlb <- subset(cces_16rlb, select = c(V101, 
                                            self_openn, self_consc, self_extra, 
                                            self_agree, self_neuro, self_emoti,
                                            obama_openn, obama_consc, obama_extra, 
                                            obama_agree, obama_neuro, obama_emoti,
                                            rep_openn, rep_consc, rep_extra, 
                                            rep_agree, rep_neuro, rep_emoti,
                                            sen1_openn, sen1_consc, sen1_extra, 
                                            sen1_agree, sen1_neuro, sen1_emoti,
                                            sen2_openn, sen2_consc, sen2_extra, 
                                            sen2_agree, sen2_neuro, sen2_emoti))

### extract stimuli ideologies
## first, representatives
cces_14$rep_ideo <- NA
cces_16$rep_ideo <- NA

# those not running for reelection
cces_14$rep_ideo[which(!is.na(cces_14$CC334V))] <- as.numeric(cces_14$CC334V[which(!is.na(cces_14$CC334V))])

# those where candidate 1 (democrat) is the incumbent
cces_14$rep_ideo[which(is.na(cces_14$rep_ideo) & 
                 (cces_14$HouseCand1IncumbentNum == 1 &
                  cces_14$HouseCand2IncumbentNum != 1))] <- 
  as.numeric(cces_14$CC334T[which(is.na(cces_14$rep_ideo) &
                                    (cces_14$HouseCand1IncumbentNum == 1 &
                                       cces_14$HouseCand2IncumbentNum != 1))])
  
# those where candidate 2 (republican) is the incumbent  
cces_14$rep_ideo[which(is.na(cces_14$rep_ideo) & 
                         (cces_14$HouseCand2IncumbentNum == 1 &
                            cces_14$HouseCand1IncumbentNum != 1))] <- 
  as.numeric(cces_14$CC334U[which(is.na(cces_14$rep_ideo) &
                                    (cces_14$HouseCand2IncumbentNum == 1 &
                                       cces_14$HouseCand1IncumbentNum != 1))])
# miscellaneous ones
cces_14$rep_ideo[which(is.na(cces_14$rep_ideo) & 
                         (cces_14$CurrentHouseName == cces_14$HouseCand1Name))] <-
  cces_14$CC334T[which(is.na(cces_14$rep_ideo) & 
                         (cces_14$CurrentHouseName == cces_14$HouseCand1Name))]

cces_14$rep_ideo[which(is.na(cces_14$rep_ideo) & 
                         (cces_14$CurrentHouseName == cces_14$HouseCand2Name))] <-
  cces_14$CC334U[which(is.na(cces_14$rep_ideo) & 
                         (cces_14$CurrentHouseName == cces_14$HouseCand2Name))]

cces_14$rep_ideo[which(is.na(cces_14$rep_ideo) & 
                       (cces_14$HouseCand2IncumbentNum != 1 &
                        cces_14$HouseCand1IncumbentNum != 1))] <- 
  cces_14$CC334V[which(is.na(cces_14$rep_ideo) & 
                         (cces_14$HouseCand2IncumbentNum != 1 &
                            cces_14$HouseCand1IncumbentNum != 1))]

cces_16$rep_ideo <- (as.numeric(cces_16$HouseCand1Incumbent) == 1)*
  (as.numeric(cces_16$CC16_340n)) + 
  (as.numeric(cces_16$HouseCand2Incumbent) == 1)*
  (as.numeric(cces_16$CC16_340o)) + 
  ((as.numeric(cces_16$HouseCand1Incumbent) != 1) & 
     (as.numeric(cces_16$HouseCand2Incumbent) != 1))*
  (as.numeric(cces_16$CC16_340p))

## now do it with Senators
cces_14$CurrentSen1Name <- factor(cces_14$CurrentSen1Name)
cces_14$CurrentSen2Name <- factor(cces_14$CurrentSen2Name)
cces_14$SenCand1Name <- factor(cces_14$SenCand1Name)
cces_14$SenCand2Name <- factor(cces_14$SenCand2Name)
cces_14$SenCand1Name2 <- factor(cces_14$SenCand1Name2)
cces_14$SenCand2Name2 <- factor(cces_14$SenCand2Name2)

## cces fails with middle names due to mismatch, so gotta correct them --- first, remove whitespace
levels(cces_14$CurrentSen1Name) <- 
  gsub("[[:space:]]*$","", 
       as.character(levels(cces_14$CurrentSen1Name)), perl=T)
levels(cces_14$CurrentSen2Name) <- 
  gsub("[[:space:]]*$","", 
       as.character(levels(cces_14$CurrentSen2Name)), perl=T)
levels(cces_14$SenCand1Name) <- 
  gsub("[[:space:]]*$","", 
       as.character(levels(cces_14$SenCand1Name)), perl=T)
levels(cces_14$SenCand2Name) <- 
  gsub("[[:space:]]*$","", 
       as.character(levels(cces_14$SenCand2Name)), perl=T)
levels(cces_14$SenCand1Name2) <- 
  gsub("[[:space:]]*$","", as.character(levels(cces_14$SenCand1Name2)), perl=T)
levels(cces_14$SenCand2Name2) <- 
  gsub("[[:space:]]*$","", as.character(levels(cces_14$SenCand2Name2)), perl=T)

cces_16$CurrentSen1Name <- factor(cces_16$CurrentSen1Name)
cces_16$CurrentSen2Name <- factor(cces_16$CurrentSen2Name)
cces_16$SenCand1Name <- factor(cces_16$SenCand1Name)
cces_16$SenCand2Name <- factor(cces_16$SenCand2Name)

levels(cces_16$CurrentSen1Name) <- 
  gsub("[[:space:]]*$","", 
       as.character(levels(cces_16$CurrentSen1Name)), perl=T)
levels(cces_16$CurrentSen2Name) <- 
  gsub("[[:space:]]*$","", 
       as.character(levels(cces_16$CurrentSen2Name)), perl=T)
levels(cces_16$SenCand1Name) <- 
  gsub("[[:space:]]*$","", 
       as.character(levels(cces_16$SenCand1Name)), perl=T)
levels(cces_16$SenCand2Name) <- 
  gsub("[[:space:]]*$","", 
       as.character(levels(cces_16$SenCand2Name)), perl=T)

levels(cces_14$CurrentSen1Name)[5] <- levels(cces_14$SenCand1Name)[6] # brian schatz
levels(cces_14$CurrentSen1Name)[13] <- levels(cces_14$SenCand1Name)[18] # jack reed
levels(cces_14$CurrentSen1Name)[14] <- levels(cces_14$SenCand2Name)[13] # jim inhofe
levels(cces_14$CurrentSen1Name)[15] <- levels(cces_14$SenCand1Name)[19] # jeanne shaheen
levels(cces_14$CurrentSen1Name)[16] <- levels(cces_14$SenCand2Name)[16] # john cornyn
levels(cces_14$CurrentSen1Name)[21] <- levels(cces_14$SenCand2Name)[19] # lamar alexander
levels(cces_14$CurrentSen1Name)[22] <- levels(cces_14$SenCand2Name)[20] # lindsey graham
levels(cces_14$CurrentSen1Name)[24] <- levels(cces_14$SenCand1Name)[23] # mark pryor
levels(cces_14$CurrentSen1Name)[25] <- levels(cces_14$SenCand1Name)[25] # mark warner
levels(cces_14$CurrentSen1Name)[26] <- levels(cces_14$SenCand1Name)[24] # mark udall
levels(cces_14$CurrentSen1Name)[27] <- levels(cces_14$SenCand1Name)[26] # mary landrieu
levels(cces_14$CurrentSen1Name)[28] <- levels(cces_14$SenCand2Name)[22] # michael enzi
levels(cces_14$CurrentSen1Name)[31] <- levels(cces_14$SenCand2Name)[25] # mitch mcconnell
levels(cces_14$CurrentSen1Name)[33] <- levels(cces_14$SenCand2Name)[27] # pat roberts
levels(cces_14$CurrentSen1Name)[39] <- levels(cces_14$SenCand1Name)[13] # richard durbin
levels(cces_14$CurrentSen1Name)[46] <- levels(cces_14$SenCand2Name)[31] # susan collins
levels(cces_14$CurrentSen1Name)[47] <- levels(cces_14$SenCand2Name)[33] # thad cochran
levels(cces_14$CurrentSen1Name)[51] <- levels(cces_14$SenCand1Name)[33] # tom udall

levels(cces_14$CurrentSen2Name)[8] <- levels(cces_14$SenCand1Name)[9] # chris coons
levels(cces_14$CurrentSen2Name)[16] <- levels(cces_14$SenCand1Name)[14] # ed markey
levels(cces_14$CurrentSen2Name)[18] <- levels(cces_14$SenCand2Name)[15] # jim risch

levels(cces_16$CurrentSen1Name)[8] <- levels(cces_16$SenCand2Name)[2] # chuck grassley
levels(cces_16$CurrentSen1Name)[9] <- levels(cces_16$SenCand1Name)[6] # chuck schumer
levels(cces_16$CurrentSen1Name)[27] <- levels(cces_16$SenCand2Name)[14] # john thune
levels(cces_16$CurrentSen1Name)[44] <- levels(cces_16$SenCand2Name)[28] # dick shelby

levels(cces_16$CurrentSen2Name)[33] <- levels(cces_16$SenCand2Name)[22] # mark kirk

### sen2 as robustness check --- 
# sen2 approval taken pre-election in 2014, tipi post-election
cces_14$sen1_ideo <- as.numeric(cces_14$CC334N)
cces_14$sen2_ideo <- as.numeric(cces_14$CC334O)
cces_16$sen1_ideo <- as.numeric(cces_16$CC16_340j)
cces_16$sen2_ideo <- as.numeric(cces_16$CC16_340k)

### cces has problems when it comes to assigning incumbent senators versus candidates
cces_14$sen1_ideo[which(as.character(cces_14$CurrentSen1Name) ==
                          as.character(cces_14$SenCand1Name))] <- 
  cces_14$CC334P[which(as.character(cces_14$CurrentSen1Name) == 
                         as.character(cces_14$SenCand1Name))]
cces_14$sen1_ideo[which(as.character(cces_14$CurrentSen1Name) ==
                          as.character(cces_14$SenCand2Name))] <- 
  cces_14$CC334Q[which(as.character(cces_14$CurrentSen1Name) == 
                         as.character(cces_14$SenCand2Name))]
cces_14$sen2_ideo[which(as.character(cces_14$CurrentSen2Name) ==
                          as.character(cces_14$SenCand1Name))] <- 
  cces_14$CC334P[which(as.character(cces_14$CurrentSen2Name) == 
                         as.character(cces_14$SenCand1Name))]
cces_14$sen2_ideo[which(as.character(cces_14$CurrentSen2Name) ==
                          as.character(cces_14$SenCand2Name))] <- 
  cces_14$CC334Q[which(as.character(cces_14$CurrentSen2Name) == 
                         as.character(cces_14$SenCand2Name))]
cces_14$sen1_ideo[which(as.character(cces_14$CurrentSen1Name) ==
                          as.character(cces_14$SenCand1Name2))] <- 
  cces_14$CC334R[which(as.character(cces_14$CurrentSen1Name) == 
                         as.character(cces_14$SenCand1Name2))]
cces_14$sen1_ideo[which(as.character(cces_14$CurrentSen1Name) ==
                          as.character(cces_14$SenCand2Name2))] <- 
  cces_14$CC334S[which(as.character(cces_14$CurrentSen1Name) == 
                         as.character(cces_14$SenCand2Name2))]
cces_14$sen2_ideo[which(as.character(cces_14$CurrentSen2Name) ==
                          as.character(cces_14$SenCand1Name2))] <- 
  cces_14$CC334R[which(as.character(cces_14$CurrentSen2Name) == 
                         as.character(cces_14$SenCand1Name2))]
cces_14$sen2_ideo[which(as.character(cces_14$CurrentSen2Name) ==
                          as.character(cces_14$SenCand2Name2))] <- 
  cces_14$CC334S[which(as.character(cces_14$CurrentSen2Name) == 
                         as.character(cces_14$SenCand2Name2))]

cces_16$sen1_ideo[which(as.character(cces_16$CurrentSen1Name) == 
                          as.character(cces_16$SenCand1Name))] <- 
  cces_16$CC16_340l[which(as.character(cces_16$CurrentSen1Name) == 
                            as.character(cces_16$SenCand1Name))]
cces_16$sen1_ideo[which(as.character(cces_16$CurrentSen1Name) == 
                          as.character(cces_16$SenCand2Name))] <- 
  cces_16$CC16_340m[which(as.character(cces_16$CurrentSen1Name) == 
                            as.character(cces_16$SenCand2Name))]
cces_16$sen2_ideo[which(as.character(cces_16$CurrentSen2Name) == 
                          as.character(cces_16$SenCand1Name))] <- 
  cces_16$CC16_340l[which(as.character(cces_16$CurrentSen2Name) == 
                            as.character(cces_16$SenCand1Name))]
cces_16$sen2_ideo[which(as.character(cces_16$CurrentSen2Name) == 
                          as.character(cces_16$SenCand2Name))] <- 
  cces_16$CC16_340m[which(as.character(cces_16$CurrentSen2Name) == 
                            as.character(cces_16$SenCand2Name))]

# assigning NAs for missing values 
cces_14$rep_ideo[cces_14$rep_ideo < 1] <- NA
cces_14$rep_ideo[cces_14$rep_ideo > 7] <- NA
cces_16$rep_ideo[cces_16$rep_ideo < 1] <- NA
cces_16$rep_ideo[cces_16$rep_ideo > 7] <- NA

cces_14$sen1_ideo[cces_14$sen1_ideo < 1] <- NA
cces_14$sen1_ideo[cces_14$sen1_ideo > 7] <- NA
cces_16$sen1_ideo[cces_16$sen1_ideo < 1] <- NA
cces_16$sen1_ideo[cces_16$sen1_ideo > 7] <- NA

cces_14$sen2_ideo[cces_14$sen2_ideo < 1] <- NA
cces_14$sen2_ideo[cces_14$sen2_ideo > 7] <- NA
cces_16$sen2_ideo[cces_16$sen2_ideo < 1] <- NA
cces_16$sen2_ideo[cces_16$sen2_ideo > 7] <- NA


# vote choice? (only for those who voted)
cces_14$rep_vote <- NA
cces_14$sen1_vote <- NA
cces_14$sen2_vote <- NA
cces_16$rep_vote <- rep(NA, length(cces_16$rep_ideo))
cces_16$sen1_vote <- rep(NA, length(cces_16$sen1_ideo))
cces_16$sen2_vote <- rep(NA, length(cces_16$sen2_ideo))

cces_14$rep_vote[which(is.na(cces_14$rep_vote) & 
                         (cces_14$HouseCand1IncumbentNum == 1 &
                            cces_14$HouseCand2IncumbentNum != 1 &
                            as.numeric(cces_14$CC412) == 1))] <- 1  

cces_14$rep_vote[which(is.na(cces_14$rep_vote) & 
                         (cces_14$HouseCand1IncumbentNum == 1 &
                            cces_14$HouseCand2IncumbentNum != 1 &
                            as.numeric(cces_14$CC412) %in% c(2,3,7)))] <- 0  

cces_14$rep_vote[which(is.na(cces_14$rep_vote) & 
                         (cces_14$HouseCand2IncumbentNum == 1 &
                            cces_14$HouseCand1IncumbentNum != 1 &
                            as.numeric(cces_14$CC412) == 2))] <- 1  

cces_14$rep_vote[which(is.na(cces_14$rep_vote) & 
                         (cces_14$HouseCand2IncumbentNum == 1 &
                            cces_14$HouseCand1IncumbentNum != 1 &
                            as.numeric(cces_14$CC412) %in% c(1,3,7)))] <- 0  


cces_14$sen1_vote[which((as.character(cces_14$CurrentSen1Name) == 
                          as.character(cces_14$SenCand1Name)) &
                          (as.numeric(cces_14$SenCand1Incumbent) == 1) & 
                          as.numeric(cces_14$CC410b) == 1)] <- 1

cces_14$sen1_vote[which((as.character(cces_14$CurrentSen1Name) == 
                           as.character(cces_14$SenCand1Name)) &
                          (as.numeric(cces_14$SenCand1Incumbent) == 1) & 
                          as.numeric(cces_14$CC410b) %in% c(2,3,4))] <- 0

cces_14$sen1_vote[which((as.character(cces_14$CurrentSen1Name) == 
                           as.character(cces_14$SenCand2Name)) &
                          (as.numeric(cces_14$SenCand2Incumbent) == 1) & 
                          as.numeric(cces_14$CC410b) == 2)] <- 1

cces_14$sen1_vote[which((as.character(cces_14$CurrentSen1Name) == 
                           as.character(cces_14$SenCand2Name)) &
                          (as.numeric(cces_14$SenCand2Incumbent) == 1) & 
                          as.numeric(cces_14$CC410b) %in% c(1,3,4))] <- 0

cces_14$sen1_vote[which((as.character(cces_14$CurrentSen1Name) == 
                           as.character(cces_14$SenCand3Name)) &
                          as.numeric(cces_14$CC410b) == 3)] <- 1

cces_14$sen1_vote[which((as.character(cces_14$CurrentSen1Name) == 
                           as.character(cces_14$SenCand3Name)) &
                          as.numeric(cces_14$CC410b) %in% c(1,2,4))] <- 0

cces_14$sen2_vote[which((as.character(cces_14$CurrentSen2Name) == 
                           as.character(cces_14$SenCand1Name)) &
                          (as.numeric(cces_14$SenCand1Incumbent) == 1) & 
                          as.numeric(cces_14$CC410b) == 1)] <- 1

cces_14$sen2_vote[which((as.character(cces_14$CurrentSen2Name) == 
                           as.character(cces_14$SenCand1Name)) &
                          (as.numeric(cces_14$SenCand1Incumbent) == 1) & 
                          as.numeric(cces_14$CC410b) %in% c(2,3,4))] <- 0

cces_14$sen2_vote[which((as.character(cces_14$CurrentSen2Name) == 
                           as.character(cces_14$SenCand2Name)) &
                          (as.numeric(cces_14$SenCand2Incumbent) == 1) & 
                          as.numeric(cces_14$CC410b) == 2)] <- 1

cces_14$sen2_vote[which((as.character(cces_14$CurrentSen2Name) == 
                           as.character(cces_14$SenCand2Name)) &
                          (as.numeric(cces_14$SenCand2Incumbent) == 1) & 
                          as.numeric(cces_14$CC410b) %in% c(1,3,4))] <- 0

cces_14$sen2_vote[which((as.character(cces_14$CurrentSen2Name) == 
                           as.character(cces_14$SenCand3Name)) &
                          as.numeric(cces_14$CC410b) == 3)] <- 1

cces_14$sen2_vote[which((as.character(cces_14$CurrentSen2Name) == 
                           as.character(cces_14$SenCand3Name)) &
                          as.numeric(cces_14$CC410b) %in% c(1,2,4))] <- 0

cces_14$sen1_vote[which((as.character(cces_14$CurrentSen1Name) == 
                           as.character(cces_14$SenCand1Name2)) &
                          as.numeric(cces_14$CC410bx) == 1)] <- 1

cces_14$sen1_vote[which((as.character(cces_14$CurrentSen1Name) == 
                           as.character(cces_14$SenCand1Name2)) &
                          as.numeric(cces_14$CC410bx) %in% c(2,3,4))] <- 0

cces_14$sen1_vote[which((as.character(cces_14$CurrentSen1Name) == 
                           as.character(cces_14$SenCand2Name2)) &
                          as.numeric(cces_14$CC410bx) == 2)] <- 1

cces_14$sen1_vote[which((as.character(cces_14$CurrentSen1Name) == 
                           as.character(cces_14$SenCand2Name2)) &
                          as.numeric(cces_14$CC410bx) %in% c(1,3,4))] <- 0

cces_14$sen1_vote[which((as.character(cces_14$CurrentSen1Name) == 
                           as.character(cces_14$SenCand3Name2)) &
                          as.numeric(cces_14$CC410bx) == 3)] <- 1

cces_14$sen1_vote[which((as.character(cces_14$CurrentSen1Name) == 
                           as.character(cces_14$SenCand3Name2)) &
                          as.numeric(cces_14$CC410bx) %in% c(1,2,4))] <- 0

cces_14$sen2_vote[which((as.character(cces_14$CurrentSen2Name) == 
                           as.character(cces_14$SenCand1Name2)) &
                          as.numeric(cces_14$CC410bx) == 1)] <- 1

cces_14$sen2_vote[which((as.character(cces_14$CurrentSen2Name) == 
                           as.character(cces_14$SenCand1Name2)) &
                          as.numeric(cces_14$CC410bx) %in% c(2,3,4))] <- 0

cces_14$sen2_vote[which((as.character(cces_14$CurrentSen2Name) == 
                           as.character(cces_14$SenCand2Name2)) &
                          as.numeric(cces_14$CC410bx) == 2)] <- 1

cces_14$sen2_vote[which((as.character(cces_14$CurrentSen2Name) == 
                           as.character(cces_14$SenCand2Name2)) &
                          as.numeric(cces_14$CC410bx) %in% c(1,3,4))] <- 0

cces_14$sen2_vote[which((as.character(cces_14$CurrentSen2Name) == 
                           as.character(cces_14$SenCand3Name2)) &
                          as.numeric(cces_14$CC410bx) == 3)] <- 1

cces_14$sen2_vote[which((as.character(cces_14$CurrentSen2Name) == 
                           as.character(cces_14$SenCand3Name2)) &
                          as.numeric(cces_14$CC410bx) %in% c(1,2,4))] <- 0

# 2016
cces_16$rep_vote[which(is.na(cces_16$rep_vote) & 
                         (as.numeric(cces_16$HouseCand1Incumbent) == 1) &
                            (as.numeric(cces_16$HouseCand2Incumbent) != 1) &
                               (as.numeric(cces_16$CC16_412) == 1))] <- 1  

cces_16$rep_vote[which(is.na(cces_16$rep_vote) &
                         (as.numeric(cces_16$HouseCand1Incumbent) == 1) &
                            (as.numeric(cces_16$HouseCand2Incumbent) != 1) &
                               (as.numeric(cces_16$CC16_412) %in% c(2:5,7:13)))] <- 0  

cces_16$rep_vote[which(is.na(cces_16$rep_vote) &
                         (as.numeric(cces_16$HouseCand2Incumbent) == 1) &
                            (as.numeric(cces_16$HouseCand1Incumbent) != 1) &
                               (as.numeric(cces_16$CC16_412) == 2))] <- 1  

cces_16$rep_vote[which(is.na(cces_16$rep_vote) &
                         (as.numeric(cces_16$HouseCand2Incumbent) == 1) &
                            (as.numeric(cces_16$HouseCand1Incumbent) != 1) &
                               (as.numeric(cces_16$CC16_412) %in% c(1,3:5,7:13)))] <- 0  

cces_16$sen1_vote[which((as.character(cces_16$CurrentSen1Name) == 
                           as.character(cces_16$SenCand1Name)) &
                          (as.numeric(as.character(cces_16$SenCand1Incumbent)) == 1) & 
                          as.numeric(cces_16$CC16_410b) == 1)] <- 1

cces_16$sen1_vote[which((as.character(cces_16$CurrentSen1Name) == 
                           as.character(cces_16$SenCand1Name)) &
                          (as.numeric(as.character(cces_16$SenCand1Incumbent)) == 1) & 
                          as.numeric(cces_16$CC16_410b) %in% c(2:4,7))] <- 0

cces_16$sen1_vote[which((as.character(cces_16$CurrentSen1Name) == 
                           as.character(cces_16$SenCand2Name)) &
                          (as.numeric(as.character(cces_16$SenCand2Incumbent)) == 1) & 
                          as.numeric(cces_16$CC16_410b) == 2)] <- 1

cces_16$sen1_vote[which((as.character(cces_16$CurrentSen1Name) == 
                           as.character(cces_16$SenCand2Name)) &
                          (as.numeric(as.character(cces_16$SenCand2Incumbent)) == 1) & 
                          as.numeric(cces_16$CC16_410b) %in% c(1,3:4,7))] <- 0

cces_16$sen2_vote[which((as.character(cces_16$CurrentSen2Name) == 
                           as.character(cces_16$SenCand1Name)) &
                          (as.numeric(as.character(cces_16$SenCand1Incumbent)) == 1) & 
                          as.numeric(cces_16$CC16_410b) == 1)] <- 1

cces_16$sen2_vote[which((as.character(cces_16$CurrentSen2Name) == 
                           as.character(cces_16$SenCand1Name)) &
                          (as.numeric(as.character(cces_16$SenCand1Incumbent)) == 1) & 
                          as.numeric(cces_16$CC16_410b) %in% c(2:4,7))] <- 0

cces_16$sen2_vote[which((as.character(cces_16$CurrentSen2Name) == 
                           as.character(cces_16$SenCand2Name)) &
                          (as.numeric(as.character(cces_16$SenCand2Incumbent)) == 1) & 
                          as.numeric(cces_16$CC16_410b) == 2)] <- 1

cces_16$sen2_vote[which((as.character(cces_16$CurrentSen2Name) == 
                           as.character(cces_16$SenCand2Name)) &
                          (as.numeric(as.character(cces_16$SenCand2Incumbent)) == 1) & 
                          as.numeric(cces_16$CC16_410b) %in% c(1,3:4,7))] <- 0

# reorder to make approval higher (for *_app2)
# *_app2: 1 = strong disapproval, 2 = somewhat disapprove, 3 = somewhat approve, 4 = strong approval
# *_app: 1 = strong approval, 2 = somewhat approve, 3 = somewhat disapprove, 4 = strong disapproval
cces_14$obama_app <- as.numeric(cces_14$CC14_308a)
cces_14$obama_app[which(cces_14$obama_app == 5)] <- NA 
cces_14$rep_app <- as.numeric(cces_14$CC14_315a)
cces_14$rep_app[which(cces_14$rep_app == 5)] <- NA 
cces_14$sen1_app <- as.numeric(cces_14$CC14_315b)
cces_14$sen1_app[which(cces_14$sen1_app == 5)] <- NA 
cces_14$sen2_app <- as.numeric(cces_14$CC14_313c)
cces_14$sen2_app[which(cces_14$sen2_app == 5)] <- NA 

cces_16$obama_app <- as.numeric(cces_16$CC16_320a)
cces_16$obama_app[which(cces_16$obama_app == 5)] <- NA 
cces_16$rep_app <- as.numeric(cces_16$CC16_320f)
cces_16$rep_app[which(cces_16$rep_app == 5)] <- NA 
cces_16$sen1_app <- as.numeric(cces_16$CC16_320g)
cces_16$sen1_app[which(cces_16$sen1_app == 5)] <- NA 
cces_16$sen2_app <- as.numeric(cces_16$CC16_320h)
cces_16$sen2_app[which(cces_16$sen2_app == 5)] <- NA 

cces_14$obama_app2 <- factor(cces_14$obama_app, levels = 4:1, labels = 1:4)
cces_14$rep_app2 <- factor(cces_14$rep_app, levels = 4:1, labels = 1:4)
cces_14$sen1_app2 <- factor(cces_14$sen1_app, levels = 4:1, labels = 1:4)
cces_14$sen2_app2 <- factor(cces_14$sen2_app, levels = 4:1, labels = 1:4)

cces_16$obama_app2 <- factor(cces_16$obama_app, levels = 4:1, labels = 1:4)
cces_16$rep_app2 <- factor(cces_16$rep_app, levels = 4:1, labels = 1:4)
cces_16$sen1_app2 <- factor(cces_16$sen1_app, levels = 4:1, labels = 1:4)
cces_16$sen2_app2 <- factor(cces_16$sen2_app, levels = 4:1, labels = 1:4)


### aldrich-mckelvey to put ideological estimates in same space
## vox populi method (ramey 2016); scale national space and then scale office-district combinations
cces_14$districts <- paste(as.character(cces_14$inputstate),"-", 
                           as.numeric(as.character(cces_14$cdid)), sep = "")
cces14_states <- factor(unique(cces_14$inputstate)[order(unique(cces_14$inputstate))])
cces14_districts <- factor(unique(cces_14$districts)[order(unique(cces_14$districts))])
cces14_district_states <- gsub("[0-9]","",gsub("-","",as.character(cces14_districts)))

cces_16$districts <- paste(as.character(cces_16$inputstate),"-", 
                           as.numeric(as.character(cces_16$cdid115)), sep = "")
cces16_states <- factor(unique(cces_16$inputstate)[order(unique(cces_16$inputstate))])
cces16_districts <- factor(unique(cces_16$districts)[order(unique(cces_16$districts))])
cces16_district_states <- gsub("[0-9]","",gsub("-","",as.character(cces16_districts)))

### scale at the national level
am_rescale <- function(subnatl, natl){
	((natl$GOPideo - natl$demsideo)/(subnatl$GOPideo - subnatl$demsideo))*subnatl - 
	((natl$GOPideo - natl$demsideo)/(subnatl$GOPideo - subnatl$demsideo))*subnatl$demsideo +
	natl$demsideo
	}

stateideos14 <- NULL
stateideos16 <- NULL

### first, scale whole country; save the estimates
ccesUSideos14 <- with(cces_14, data.frame(CC334A, CC334C, CC334D, 
                                          CC334K, CC334L, CC334W))
colnames(ccesUSideos14) <- c("selfideo", "obamaideo", "HRCideo", 
                             "demsideo", "GOPideo", "scotusideo")
ccesUSideos14[,1] <- as.numeric(ccesUSideos14[,1])
ccesUSideos14[,2] <- as.numeric(ccesUSideos14[,2])
ccesUSideos14[,3] <- as.numeric(ccesUSideos14[,3])
ccesUSideos14[,4] <- as.numeric(ccesUSideos14[,4])
ccesUSideos14[,5] <- as.numeric(ccesUSideos14[,5])
ccesUSideos14[,6] <- as.numeric(ccesUSideos14[,6])
ccesUSideos14[which(ccesUSideos14[,1] > 7),1] <- NA
ccesUSideos14[which(ccesUSideos14[,2] > 7),2] <- NA
ccesUSideos14[which(ccesUSideos14[,3] > 7),3] <- NA
ccesUSideos14[which(ccesUSideos14[,4] > 7),4] <- NA
ccesUSideos14[which(ccesUSideos14[,5] > 7),5] <- NA
ccesUSideos14[which(ccesUSideos14[,6] > 7),6] <- NA
US.foo14 <- aldmck(ccesUSideos14, respondent = 1, polarity = 4)
US.out14 <- data.frame(idealpoint = US.foo14$respondents[,c('idealpt')],
                       t(US.foo14$stimuli[c('demsideo','GOPideo')]),
                       state = cces_14$inputstate,
                       district = as.numeric(as.character(cces_14$cdid)),
                       statedistrict = cces_14$districts)
US.out.positions14 <- data.frame(t(US.foo14$stimuli))

ccesUSideos16 <- with(cces_16, data.frame(CC16_340a, CC16_340c, 
                                          CC16_340d, CC16_340g, CC16_340h, CC16_340i))
colnames(ccesUSideos16) <- c("selfideo", "obamaideo", "HRCideo", 
                             "demsideo", "GOPideo", "scotusideo")
ccesUSideos16[,1] <- as.numeric(ccesUSideos16[,1])
ccesUSideos16[,2] <- as.numeric(ccesUSideos16[,2])
ccesUSideos16[,3] <- as.numeric(ccesUSideos16[,3])
ccesUSideos16[,4] <- as.numeric(ccesUSideos16[,4])
ccesUSideos16[,5] <- as.numeric(ccesUSideos16[,5])
ccesUSideos16[,6] <- as.numeric(ccesUSideos16[,6])
ccesUSideos16[which(ccesUSideos16[,1] > 7),1] <- NA
ccesUSideos16[which(ccesUSideos16[,2] > 7),2] <- NA
ccesUSideos16[which(ccesUSideos16[,3] > 7),3] <- NA
ccesUSideos16[which(ccesUSideos16[,4] > 7),4] <- NA
ccesUSideos16[which(ccesUSideos16[,5] > 7),5] <- NA
ccesUSideos16[which(ccesUSideos16[,6] > 7),6] <- NA
US.foo16 <- aldmck(ccesUSideos16, respondent = 1, polarity = 4)
US.out16 <- data.frame(idealpoint = US.foo16$respondents[,c('idealpt')],
                       t(US.foo16$stimuli[c('demsideo','GOPideo')]),
                       state = cces_16$inputstate,
                       district = as.numeric(as.character(cces_16$cdid115)),
                       statedistrict = cces_16$districts)
US.out.positions16 <- data.frame(t(US.foo16$stimuli))

### then, scale states
stateideos14 <- NULL
stateideos16 <- NULL

for(i in 1:length(cces14_states)){ 
	foo_cces <- cces_14[factor(cces_14$inputstate) == cces14_states[i],]
	foo_ideos <- with(foo_cces, data.frame(CC334A, sen1_ideo, sen2_ideo, CC334K, CC334L))
	colnames(foo_ideos) <- c("selfideo", "sen1ideo", "sen2ideo", "demsideo", "GOPideo")
	foo_ideos[,1] <- as.numeric(foo_ideos[,1])
	foo_ideos[,2] <- as.numeric(foo_ideos[,2])
	foo_ideos[,3] <- as.numeric(foo_ideos[,3])
	foo_ideos[,4] <- as.numeric(foo_ideos[,4])
	foo_ideos[,5] <- as.numeric(foo_ideos[,5])
	foo_ideos[which(foo_ideos[,1] > 7),1] <- NA
	foo_ideos[which(foo_ideos[,2] > 7),2] <- NA
	foo_ideos[which(foo_ideos[,3] > 7),3] <- NA
	foo_ideos[which(foo_ideos[,4] > 7),4] <- NA
	foo_ideos[which(foo_ideos[,5] > 7),5] <- NA
	if(dim(foo_ideos)[1] > 1){
		foo.aldmck <- aldmck(foo_ideos, respondent = 1, polarity = 4)
	    if(dim(na.omit(foo.aldmck$respondents))[1] == 0){
	    	    print(i)}
	           else{foo.out <- data.frame(t(foo.aldmck$stimuli))
	           foo.out <- am_rescale(foo.out[,c('sen1ideo', 'sen2ideo', 
	                                            'demsideo', 'GOPideo')], 
	                                 US.out.positions14)
               foo.out <- data.frame(foo.out, 
                                     state = cces14_states[i])
               stateideos14 <- rbind(stateideos14, foo.out)
               print(i)}
               }
        else{print(i)}
}

cces_16df <- as.data.frame(cces_16)

for(i in 1:length(cces16_states)){ 
  foo_cces <- cces_16df[factor(cces_16$inputstate) == cces16_states[i],]
  foo_ideos <- with(foo_cces, data.frame(CC16_340a, sen1_ideo, 
                                         sen2_ideo, CC16_340g, CC16_340h))
  colnames(foo_ideos) <- c("selfideo", "sen1ideo", "sen2ideo", 
                           "demsideo", "GOPideo")
  foo_ideos[,1] <- as.numeric(foo_ideos[,1])
  foo_ideos[,2] <- as.numeric(foo_ideos[,2])
  foo_ideos[,3] <- as.numeric(foo_ideos[,3])
  foo_ideos[,4] <- as.numeric(foo_ideos[,4])
  foo_ideos[,5] <- as.numeric(foo_ideos[,5])
  foo_ideos[which(foo_ideos[,1] > 7),1] <- NA
  foo_ideos[which(foo_ideos[,2] > 7),2] <- NA
  foo_ideos[which(foo_ideos[,3] > 7),3] <- NA
  foo_ideos[which(foo_ideos[,4] > 7),4] <- NA
  foo_ideos[which(foo_ideos[,5] > 7),5] <- NA
  if(dim(foo_ideos)[1] > 1){
    foo.aldmck <- aldmck(foo_ideos, respondent = 1, polarity = 4)
    if(dim(na.omit(foo.aldmck$respondents))[1] == 0){
      print(i)}
    else{foo.out <- data.frame(t(foo.aldmck$stimuli))
    foo.out <- am_rescale(foo.out[,c('sen1ideo', 'sen2ideo', 
                                     'demsideo', 'GOPideo')], 
                          US.out.positions16)
    foo.out <- data.frame(foo.out, 
                          state = cces16_states[i])
    stateideos16 <- rbind(stateideos16, foo.out)
    print(i)}
  }
  else{print(i)}
}

### finally, scale districts
districtideos14 <- NULL
districtideos16 <- NULL

for(i in 1:length(cces14_districts)){ 
	foo_cces <- cces_14[factor(cces_14$districts) == cces14_districts[i],]
	foo_ideos <- with(foo_cces, data.frame(CC334A, rep_ideo, CC334K, CC334L))
	colnames(foo_ideos) <- c("selfideo", "repideo", "demsideo", "GOPideo")
	foo_ideos[,1] <- as.numeric(foo_ideos[,1])
	foo_ideos[,2] <- as.numeric(foo_ideos[,2])
	foo_ideos[,3] <- as.numeric(foo_ideos[,3])
	foo_ideos[,4] <- as.numeric(foo_ideos[,4])
	foo_ideos[which(foo_ideos[,1] > 7),1] <- NA
	foo_ideos[which(foo_ideos[,2] > 7),2] <- NA
	foo_ideos[which(foo_ideos[,3] > 7),3] <- NA
	foo_ideos[which(foo_ideos[,4] > 7),4] <- NA
	if(dim(foo_ideos)[1] > 1){
		foo.aldmck <- aldmck(foo_ideos, respondent = 1, polarity = 3)
	    if(dim(na.omit(foo.aldmck$respondents))[1] == 0){
	    	    print(i)}
	           else{foo.out <- data.frame(foo.aldmck$respondents, t(foo.aldmck$stimuli))
	           foo.out <- am_rescale(foo.out[,c('repideo', 'demsideo', 
	                                            'GOPideo')], 
	                                 US.out.positions14)
               foo.out <- data.frame(foo.out, 
                                     statedistrict = cces14_districts[i],
                                     state = cces14_district_states[i])
               districtideos14 <- rbind(districtideos14, foo.out)
               print(i)}
               }
        else{print(i)}
}

for(i in 1:length(cces16_districts)){ 
  foo_cces <- cces_16df[factor(cces_16$districts) == cces16_districts[i],]
  foo_ideos <- with(foo_cces, data.frame(CC16_340a, rep_ideo, 
                                         CC16_340g, CC16_340h))
  colnames(foo_ideos) <- c("selfideo", "repideo", 
                           "demsideo", "GOPideo")
  foo_ideos[,1] <- as.numeric(foo_ideos[,1])
  foo_ideos[,2] <- as.numeric(foo_ideos[,2])
  foo_ideos[,3] <- as.numeric(foo_ideos[,3])
  foo_ideos[,4] <- as.numeric(foo_ideos[,4])
  foo_ideos[which(foo_ideos[,1] > 7),1] <- NA
  foo_ideos[which(foo_ideos[,2] > 7),2] <- NA
  foo_ideos[which(foo_ideos[,3] > 7),3] <- NA
  foo_ideos[which(foo_ideos[,4] > 7),4] <- NA
  if(dim(foo_ideos)[1] > 1){
    foo.aldmck <- aldmck(foo_ideos, respondent = 1, polarity = 3)
    if(dim(na.omit(foo.aldmck$respondents))[1] == 0){
      print(i)}
    else{foo.out <- data.frame(foo.aldmck$respondents, 
                               t(foo.aldmck$stimuli))
    foo.out <- am_rescale(foo.out[,c('repideo', 'demsideo', 
                                     'GOPideo')], 
                          US.out.positions16)
    foo.out <- data.frame(foo.out, 
                          statedistrict = cces16_districts[i],
                          state = cces16_district_states[i])
    districtideos16 <- rbind(districtideos16, foo.out)
    print(i)}
  }
  else{print(i)}
}


### combine all the aldrich-mckelvey estimates
cces_14$respondent_AM <- US.out14$idealpoint
cces_14$obama_AM <- US.out.positions14$obamaideo
cces_14$demparty_AM <- US.out14$demsideo
cces_14$GOPparty_AM <- US.out14$GOPideo
cces_14$state <- as.character(cces_14$inputstate)
cces_14 <- plyr::rename(cces_14, replace = c("districts" = "statedistrict")) 
cces_14 <- merge(stateideos14[,c('sen1ideo','sen2ideo','state')] , 
                 cces_14, by = "state", all = TRUE)
cces_14 <- merge(na.omit(unique(districtideos14))[,c('repideo','statedistrict')], 
                 cces_14, by = "statedistrict", all = TRUE)
cces_14 <- plyr::rename(cces_14, replace = c("sen1ideo" = "sen1_AM", 
                                             "sen2ideo" = "sen2_AM", 
                                             "repideo" = "rep_AM")) 

cces_16$respondent_AM <- US.out16$idealpoint
cces_16$obama_AM <- US.out.positions16$obamaideo
cces_16$demparty_AM <- US.out16$demsideo
cces_16$GOPparty_AM <- US.out16$GOPideo
cces_16$state <- as.character(cces_16$inputstate)
cces_16 <- plyr::rename(cces_16, replace = c("districts" = "statedistrict")) 
cces_16 <- merge(stateideos16[,c('sen1ideo','sen2ideo','state')] , 
                 cces_16, by = "state", all = TRUE)
cces_16 <- merge(na.omit(unique(districtideos16))[,c('repideo','statedistrict')], 
                 cces_16, by = "statedistrict", all = TRUE)
cces_16 <- plyr::rename(cces_16, replace = c("sen1ideo" = "sen1_AM", 
                                             "sen2ideo" = "sen2_AM", 
                                             "repideo" = "rep_AM")) 


### create big MLM framework
# making the 150k or more income level consistent
cces_14$faminc_recode <- cces_14$faminc
cces_14$faminc_recode[which(cces_14$faminc_recode == "$150,000 - $199,999")] <- 
  levels(cces_14$faminc_recode)[17] 
cces_14$faminc_recode[which(cces_14$faminc_recode == "$200,000 - $249,999")] <- 
  levels(cces_14$faminc_recode)[17] 
cces_14$faminc_recode[which(cces_14$faminc_recode == "$250,000 - $349,999")] <- 
  levels(cces_14$faminc_recode)[17] 
cces_14$faminc_recode[which(cces_14$faminc_recode == "$350,000 - $499,999")] <- 
  levels(cces_14$faminc_recode)[17] 
cces_14$faminc_recode[which(cces_14$faminc_recode == "$500,000 or more")] <- 
  levels(cces_14$faminc_recode)[17] 
cces_14$faminc_recode[which(cces_14$faminc_recode == "$250,000 or more ")] <- 
  levels(cces_14$faminc_recode)[17] 
cces_14$faminc_recode <- factor(cces_14$faminc_recode)

cces_16$faminc_recode <- cces_16$faminc
cces_16$faminc_recode[which(cces_16$faminc_recode == "$150,000 - $199,999")] <- 
  levels(cces_16$faminc_recode)[17] 
cces_16$faminc_recode[which(cces_16$faminc_recode == "$200,000 - $249,999")] <- 
  levels(cces_16$faminc_recode)[17] 
cces_16$faminc_recode[which(cces_16$faminc_recode == "$250,000 - $349,999")] <- 
  levels(cces_16$faminc_recode)[17] 
cces_16$faminc_recode[which(cces_16$faminc_recode == "$350,000 - $499,999")] <- 
  levels(cces_16$faminc_recode)[17] 
cces_16$faminc_recode[which(cces_16$faminc_recode == "$500,000 or more")] <- 
  levels(cces_16$faminc_recode)[17] 
cces_16$faminc_recode <- factor(cces_16$faminc_recode)


# need to recode hispanic for clmm
cces_14$newhispanic <- as.numeric(cces_14$race == "Hispanic"|cces_14$hispanic == "Yes")
cces_16$newhispanic <- as.numeric(cces_16$race == "Hispanic"|cces_16$hispanic == "Yes")

# candidate indicators
cces_14$sen1cand <- (as.character(cces_14$CurrentSen1Name) == 
                       as.character(cces_14$SenCand1Name)) +
                    (as.character(cces_14$CurrentSen1Name) == 
                       as.character(cces_14$SenCand2Name)) +
                    (as.character(cces_14$CurrentSen1Name) == 
                       as.character(cces_14$SenCand1Name2)) +
                    (as.character(cces_14$CurrentSen1Name) == 
                       as.character(cces_14$SenCand2Name2))

cces_14$sen2cand <- (as.character(cces_14$CurrentSen2Name) == 
                       as.character(cces_14$SenCand1Name)) +
                    (as.character(cces_14$CurrentSen2Name) == 
                       as.character(cces_14$SenCand2Name)) +
                    (as.character(cces_14$CurrentSen2Name) == 
                       as.character(cces_14$SenCand1Name2)) +
                    (as.character(cces_14$CurrentSen2Name) == 
                       as.character(cces_14$SenCand2Name2))

cces_16$sen1cand <- (as.character(cces_16$CurrentSen1Name) == 
                       as.character(cces_16$SenCand1Name)) +
                    (as.character(cces_16$CurrentSen1Name) == 
                       as.character(cces_16$SenCand2Name)) 

cces_16$sen2cand <- (as.character(cces_16$CurrentSen2Name) == 
                       as.character(cces_16$SenCand1Name)) +
                    (as.character(cces_16$CurrentSen2Name) == 
                       as.character(cces_16$SenCand2Name))

# miscellaneous variables
cces_14$birthyr <- as.numeric(cces_14$birthyr)
cces_16$birthyr <- as.numeric(cces_16$birthyr)
cces_14$houseparty <- gsub("[[:space:]]*$","", 
                           as.character((cces_14$CurrentHouseParty)), perl=T)
cces_16$houseparty <- gsub("[[:space:]]*$","", 
                           as.character((cces_16$CurrentHouseParty)), perl=T)
cces_14$sen1party <- gsub("[[:space:]]*$","", 
                          as.character((cces_14$CurrentSen1Party)), perl=T)
cces_16$sen1party <- gsub("[[:space:]]*$","", 
                          as.character((cces_16$CurrentSen1Party)), perl=T)
cces_14$sen2party <- gsub("[[:space:]]*$","", 
                          as.character((cces_14$CurrentSen2Party)), perl=T)
cces_16$sen2party <- gsub("[[:space:]]*$","", 
                          as.character((cces_16$CurrentSen2Party)), perl=T)

# extract variables used from modules for later merging with common content
newcces_14 <- subset(cces_14, select = c(V101, newhispanic, rep_app2, sen1_app2, 
                                         sen2_app2, obama_app2, respondent_AM,
                                         demparty_AM, GOPparty_AM, obama_AM, 
                                         rep_AM, sen1_AM, sen2_AM, state,
                                         statedistrict, newsint, gender, 
                                         birthyr, race, employ,
                                         sen1cand, sen2cand, educ, faminc_recode, 
                                         houseparty, sen1party, sen2party,
                                         CurrentHouseName, CurrentSen1Name, 
                                         CurrentSen2Name,
                                         rep_ideo, sen1_ideo, sen2_ideo, CA_info, pid3, 
                                         CurrentSen1Party, CurrentSen2Party, 
                                         CurrentHouseParty,
                                         rep_vote, sen1_vote, sen2_vote))

newcces_16 <- subset(cces_16, select = c(V101, newhispanic, rep_app2, sen1_app2, 
                                         sen2_app2, obama_app2, respondent_AM,
                                         demparty_AM, GOPparty_AM, obama_AM, 
                                         rep_AM, sen1_AM, sen2_AM, state,
                                         statedistrict, newsint, gender, 
                                         birthyr, race, employ,
                                         sen1cand, sen2cand, educ, faminc_recode, 
                                         houseparty, sen1party, sen2party,
                                         CurrentHouseName, CurrentSen1Name, 
                                         CurrentSen2Name,
                                         rep_ideo, sen1_ideo, sen2_ideo, CA_info, pid3, 
                                         CurrentSen1Party, CurrentSen2Party, 
                                         CurrentHouseParty,
                                         rep_vote, sen1_vote, sen2_vote))

# merge the common content and modules together
newcces_14_merged <- merge(newcces_14, cces_14rlb)
newcces_16_merged <- merge(newcces_16, cces_16rlb)

# remove those with missing self-tipis
newcces_14_merged <- newcces_14_merged[which(!is.na(newcces_14_merged$self_openn) & 
                                             !is.na(newcces_14_merged$self_consc) & 
                                             !is.na(newcces_14_merged$self_extra) & 
                                             !is.na(newcces_14_merged$self_agree) & 
                                             !is.na(newcces_14_merged$self_neuro) &
                                             !is.na(newcces_14_merged$self_emoti)),]

newcces_16_merged <- newcces_16_merged[which(!is.na(newcces_16_merged$self_openn) & 
                                             !is.na(newcces_16_merged$self_consc) & 
                                             !is.na(newcces_16_merged$self_extra) & 
                                             !is.na(newcces_16_merged$self_agree) & 
                                             !is.na(newcces_16_merged$self_neuro) & 
                                             !is.na(newcces_16_merged$self_emoti)),]

# create copartisan variable
newcces_14_merged$sen1_copartisan <- 
  with(newcces_14_merged, 
       as.numeric((pid3 == "Democrat" & 
                     CurrentSen1Party == "Democratic") |
                    (pid3 == "Republican" & 
                       CurrentSen1Party == "Republican") |
                    (pid3 %in% c("Independent", "Other") & 
                       CurrentSen1Party == "Independent")))

newcces_14_merged$sen2_copartisan <- 
  with(newcces_14_merged, 
       as.numeric((pid3 == "Democrat" &
                     CurrentSen2Party == "Democratic") |
                    (pid3 == "Republican" & 
                       CurrentSen2Party == "Republican") |
                    (pid3 %in% c("Independent", "Other") & 
                       CurrentSen2Party == "Independent")))

newcces_16_merged$sen1_copartisan <- 
  with(newcces_16_merged, 
       as.numeric((pid3 == "Democrat" & 
                     CurrentSen1Party == "Democratic") |
                    (pid3 == "Republican" & 
                       CurrentSen1Party == "Republican") |
                    (pid3 %in% c("Independent", "Other") & 
                       CurrentSen1Party == "Independent")))

newcces_16_merged$sen2_copartisan <- 
  with(newcces_16_merged, 
       as.numeric((pid3 == "Democrat" & 
                     CurrentSen2Party == "Democratic") |
                    (pid3 == "Republican" & 
                       CurrentSen2Party == "Republican") |
                    (pid3 %in% c("Independent", "Other") & 
                       CurrentSen2Party == "Independent")))

# year indicators to help create random effects
newcces_14_merged$year <- "2014"
newcces_16_merged$year <- "2016"

# subset into office-specific data frames for remerging later
cces14.rep <- subset(newcces_14_merged, 
                     select = -c(CurrentSen1Party, CurrentSen2Party))
cces14.sen1 <- subset(newcces_14_merged,
                      select = -c(CurrentSen2Party, CurrentHouseParty))
cces14.sen2 <- subset(newcces_14_merged,
                      select = -c(CurrentSen1Party, CurrentHouseParty))
cces16.rep <- subset(newcces_16_merged,
                     select = -c(CurrentSen1Party, CurrentSen2Party))
cces16.sen1 <- subset(newcces_16_merged, 
                      select = -c(CurrentSen2Party, CurrentHouseParty))
cces16.sen2 <- subset(newcces_16_merged, 
                      select = -c(CurrentSen1Party, CurrentHouseParty))

# rename office-specific columns for later merging into omnibus data frames
names(cces14.rep) <- sub('CurrentHouseParty', 
                         'cong_party', names(cces14.rep))
names(cces14.sen1) <- sub('CurrentSen1Party', 
                          'cong_party', names(cces14.sen1))
names(cces14.sen2) <- sub('CurrentSen2Party', 
                          'cong_party', names(cces14.sen2))
names(cces16.rep) <- sub('CurrentHouseParty', 
                         'cong_party', names(cces16.rep))
names(cces16.sen1) <- sub('CurrentSen1Party', 
                          'cong_party', names(cces16.sen1))
names(cces16.sen2) <- sub('CurrentSen2Party', 
                          'cong_party', names(cces16.sen2))

# fix some issues with the copartisanship variable
cces14.rep$copartisan <- 
  with(cces14.rep, as.numeric((pid3 == "Democrat" & cong_party == "Democratic") |
                    (pid3 == "Republican" & cong_party == "Republican") |
                    (pid3 %in% c("Independent", "Other") & cong_party == "Independent")))
                              

cces14.sen1$copartisan <-
  with(cces14.sen1, as.numeric((pid3 == "Democrat" & cong_party == "Democratic") |
                                 (pid3 == "Republican" & cong_party == "Republican") |
                                 (pid3 %in% c("Independent", "Other") & 
                                    cong_party == "Independent")))

cces14.sen2$copartisan <- 
  with(cces14.sen2, as.numeric((pid3 == "Democrat" & cong_party == "Democratic") |
                                 (pid3 == "Republican" & cong_party == "Republican") |
                                 (pid3 %in% c("Independent", "Other") & 
                                    cong_party == "Independent")))

cces16.rep$copartisan <- 
  with(cces16.rep, as.numeric((pid3 == "Democrat" & cong_party == "Democratic") |
                                (pid3 == "Republican" & cong_party == "Republican") |
                                (pid3 %in% c("Independent", "Other") & 
                                   cong_party == "Independent")))


cces16.sen1$copartisan <- 
  with(cces16.sen1, as.numeric((pid3 == "Democrat" & cong_party == "Democratic") |
                                 (pid3 == "Republican" & cong_party == "Republican") |
                                 (pid3 %in% c("Independent", "Other") & 
                                    cong_party == "Independent")))

cces16.sen2$copartisan <- 
  with(cces16.sen2, as.numeric((pid3 == "Democrat" & cong_party == "Democratic") |
                                 (pid3 == "Republican" & cong_party == "Republican") |
                                 (pid3 %in% c("Independent", "Other") & 
                                    cong_party == "Independent")))

### create a mean function that automatically removes missing values
Mean <- function(x){mean(x, na.rm = TRUE)}

### fixing more names for creating omnibus frame later
## representatives
cces14.rep$cong_AM <- cces14.rep$rep_AM
cces14.rep$cong_openn <- cces14.rep$rep_openn
cces14.rep$cong_consc <- cces14.rep$rep_consc
cces14.rep$cong_extra <- cces14.rep$rep_extra
cces14.rep$cong_agree <- cces14.rep$rep_agree
cces14.rep$cong_neuro <- cces14.rep$rep_neuro
cces14.rep$cong_emoti <- cces14.rep$rep_emoti
cces14.rep$cong_app <- cces14.rep$rep_app2
cces14.rep$cong_vote <- cces14.rep$rep_vote
cces14.rep$office <- "Representative"
cces14.rep$office2 <- "Representative"
cces14.rep$office3 <- "Representative - 2014"
cces14.rep$deminc <- as.numeric(cces14.rep$houseparty == "Democratic")
cces14.rep$repinc <- as.numeric(cces14.rep$houseparty == "Republican")

cces16.rep$cong_AM <- cces16.rep$rep_AM
cces16.rep$cong_openn <- cces16.rep$rep_openn
cces16.rep$cong_consc <- cces16.rep$rep_consc
cces16.rep$cong_extra <- cces16.rep$rep_extra
cces16.rep$cong_agree <- cces16.rep$rep_agree
cces16.rep$cong_neuro <- cces16.rep$rep_neuro
cces16.rep$cong_emoti <- cces16.rep$rep_emoti
cces16.rep$cong_app <- cces16.rep$rep_app2
cces16.rep$cong_vote <- cces16.rep$rep_vote
cces16.rep$office <- "Representative"
cces16.rep$office2 <- "Representative"
cces16.rep$office3 <- "Representative - 2016"
cces16.rep$deminc <- as.numeric(cces16.rep$houseparty == "Democratic")
cces16.rep$repinc <- as.numeric(cces16.rep$houseparty == "Republican")

## senator 1s
cces14.sen1$cong_AM <- cces14.sen1$sen1_AM
cces14.sen1$cong_openn <- cces14.sen1$sen1_openn
cces14.sen1$cong_consc <- cces14.sen1$sen1_consc
cces14.sen1$cong_extra <- cces14.sen1$sen1_extra
cces14.sen1$cong_agree <- cces14.sen1$sen1_agree
cces14.sen1$cong_neuro <- cces14.sen1$sen1_neuro
cces14.sen1$cong_emoti <- cces14.sen1$sen1_emoti
cces14.sen1$cong_app <- cces14.sen1$sen1_app2
cces14.sen1$cong_vote <- cces14.sen1$sen1_vote
cces14.sen1$office <- "Senator 1"
cces14.sen1$office2 <- "Senator"
cces14.sen1$office3 <- "Senator - 2014"
cces14.sen1$deminc <- as.numeric(cces14.sen1$sen1party == "Democratic")
cces14.sen1$repinc <- as.numeric(cces14.sen1$sen1party == "Republican")

cces16.sen1$cong_AM <- cces16.sen1$sen1_AM
cces16.sen1$cong_openn <- cces16.sen1$sen1_openn
cces16.sen1$cong_consc <- cces16.sen1$sen1_consc
cces16.sen1$cong_extra <- cces16.sen1$sen1_extra
cces16.sen1$cong_agree <- cces16.sen1$sen1_agree
cces16.sen1$cong_neuro <- cces16.sen1$sen1_neuro
cces16.sen1$cong_emoti <- cces16.sen1$sen1_emoti
cces16.sen1$cong_app <- cces16.sen1$sen1_app2
cces16.sen1$cong_vote <- cces16.sen1$sen1_vote
cces16.sen1$office <- "Senator 1"
cces16.sen1$office2 <- "Senator"
cces16.sen1$office3 <- "Senator - 2016"
cces16.sen1$deminc <- as.numeric(cces16.sen1$sen1party == "Democratic")
cces16.sen1$repinc <- as.numeric(cces16.sen1$sen1party == "Republican")

## senator 2s
cces14.sen2$cong_AM <- cces14.sen2$sen2_AM
cces14.sen2$cong_openn <- cces14.sen2$sen2_openn
cces14.sen2$cong_consc <- cces14.sen2$sen2_consc
cces14.sen2$cong_extra <- cces14.sen2$sen2_extra
cces14.sen2$cong_agree <- cces14.sen2$sen2_agree
cces14.sen2$cong_neuro <- cces14.sen2$sen2_neuro
cces14.sen2$cong_emoti <- cces14.sen2$sen2_emoti
cces14.sen2$cong_app <- cces14.sen2$sen2_app2
cces14.sen2$cong_vote <- cces14.sen2$sen2_vote
cces14.sen2$office <- "Senator 2"
cces14.sen2$office2 <- "Senator"
cces14.sen2$office3 <- "Senator - 2014"
cces14.sen2$deminc <- as.numeric(cces14.sen2$sen2party == "Democratic")
cces14.sen2$repinc <- as.numeric(cces14.sen2$sen2party == "Republican")

cces16.sen2$cong_AM <- cces16.sen2$sen2_AM
cces16.sen2$cong_openn <- cces16.sen2$sen2_openn
cces16.sen2$cong_consc <- cces16.sen2$sen2_consc
cces16.sen2$cong_extra <- cces16.sen2$sen2_extra
cces16.sen2$cong_agree <- cces16.sen2$sen2_agree
cces16.sen2$cong_neuro <- cces16.sen2$sen2_neuro
cces16.sen2$cong_emoti <- cces16.sen2$sen2_emoti
cces16.sen2$cong_app <- cces16.sen2$sen2_app2
cces16.sen2$cong_vote <- cces16.sen2$sen2_vote
cces16.sen2$office <- "Senator 2"
cces16.sen2$office2 <- "Senator"
cces16.sen2$office3 <- "Senator - 2016"
cces16.sen2$deminc <- as.numeric(cces16.sen2$sen2party == "Democratic")
cces16.sen2$repinc <- as.numeric(cces16.sen2$sen2party == "Republican")


### creating omnibus frames
cces.both <- rbind(newcces_14_merged, newcces_16_merged)
cces14.big <- smartbind(smartbind(cces14.rep, cces14.sen1), cces14.sen2)
cces16.big <- smartbind(smartbind(cces16.rep, cces16.sen1), cces16.sen2)
cces.rep <- smartbind(cces14.rep, cces16.rep)
cces.sen <- smartbind(smartbind(cces14.sen1, cces14.sen2), 
                      smartbind(cces16.sen1, cces16.sen2))
cces.uber <- smartbind(cces14.big, cces16.big)


## rescaling the political information variables to have mean zero and stdev one
cces.both$scaled_info <- as.numeric(scale(cces.both$CA_info))
cces14.big$scaled_info <- as.numeric(scale(cces14.big$CA_info))
cces16.big$scaled_info <- as.numeric(scale(cces16.big$CA_info))
cces.rep$scaled_info <- as.numeric(scale(cces.rep$CA_info))
cces.sen$scaled_info <- as.numeric(scale(cces.sen$CA_info))
cces.uber$scaled_info <- as.numeric(scale(cces.uber$CA_info))
cces14.sen2$scaled_info <- as.numeric(scale(cces14.sen2$CA_info))
newcces_16_merged$scaled_info <- as.numeric(scale(newcces_16_merged$CA_info))


## creating custom texreg function to work with clmm
extract.clmm <- function(model, include.thresholds = TRUE, include.aic = TRUE, 
    include.bic = TRUE, include.loglik = TRUE, oddsratios = FALSE, 
    conf.level= 0.95, include.nobs = TRUE, ...) {
  s <- summary(model, ...)
  
  tab <- s$coefficients
  thresh <- tab[rownames(tab) %in% names(s$alpha), ]
  threshold.names <- rownames(thresh)
  threshold.coef <- thresh[, 1]
  threshold.se <- thresh[, 2]
  threshold.pval <- thresh[, 4]
  beta <- tab[rownames(tab) %in% names(s$beta), ]
  beta.names <- rownames(beta)
  beta.coef <- beta[, 1]
  beta.se <- beta[, 2]
  beta.pval <- beta[, 4]
    
  if (include.thresholds == TRUE) {
    names <- c(beta.names, threshold.names)
    coef <- c(beta.coef, threshold.coef)
    se <- c(beta.se, threshold.se)
    pval <- c(beta.pval, threshold.pval)
  } else {
    names <- beta.names
    coef <- beta.coef
    se <- beta.se
    pval <- beta.pval
  }
  
  n <- nobs(model)
  lik <- logLik(model)[1]
  aic <- AIC(model)
  bic <- BIC(model)
  gof <- numeric()
  gof.names <- character()
  gof.decimal <- logical()
  if (include.aic == TRUE) {
    gof <- c(gof, aic)
    gof.names <- c(gof.names, "AIC")
    gof.decimal <- c(gof.decimal, TRUE)
  }
  if (include.bic == TRUE) {
    gof <- c(gof, bic)
    gof.names <- c(gof.names, "BIC")
    gof.decimal <- c(gof.decimal, TRUE)
  }
  if (include.loglik == TRUE) {
    gof <- c(gof, lik)
    gof.names <- c(gof.names, "Log Likelihood")
    gof.decimal <- c(gof.decimal, TRUE)
  }
  if (include.nobs == TRUE) {
    gof <- c(gof, n)
    gof.names <- c(gof.names, "Num.\ obs.")
    gof.decimal <- c(gof.decimal, FALSE)
  }

    if (oddsratios == TRUE) {
        ss = (exp(cbind(OR =coef(model), confint(model, level = conf.level))))
        dd =as.data.frame(as.table(ss))        
        remove.rows <- grep("|", dd$Var1, fixed=TRUE) 
        no_intercepts <- dd[-remove.rows,]
        coefficients = no_intercepts[no_intercepts$Var2 == 'OR',]$Freq
        coefficient.names = as.character(no_intercepts[no_intercepts$Var2 == 'OR',]$Var1)
        ci.low = no_intercepts[no_intercepts$Var2 == '2.5 %',]$Freq
        ci.up  = no_intercepts[no_intercepts$Var2 == '97.5 %',]$Freq
        
        tr <- createTexreg(
          coef.names = coefficient.names, 
          coef = coefficients, 
          ci.low = ci.low, 
          ci.up = ci.up, 
          gof.names = gof.names, 
          gof = gof, 
          gof.decimal = gof.decimal
        )
    } 
    else {
      tr <- createTexreg(
          coef.names = names, 
          coef = coef, 
          se = se, 
          pvalues = pval, 
          gof.names = gof.names, 
          gof = gof, 
          gof.decimal = gof.decimal
      )
   } 
  return(tr)
}

setMethod("extract", signature = className("clmm", "ordinal"), 
    definition = extract.clmm)



### estimating a bunch of models
# con = congruence models; val = valence models; big = encompassing models
# all = all legislators; rep = representatives only; sen = senators only
set.seed(1)
mod.all.val.1.ordered <- clmm(factor(cong_app) ~ cong_openn + cong_consc + cong_extra + 
                                                 cong_agree + cong_emoti +
                                                 (1|office3) + (1|state) + 
                                                 (1|statedistrict) + (1|V101),
                              data = cces.uber)

mod.all.val.1.ordered.copartisan <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                            cong_extra + cong_agree +
                                                            cong_emoti +
                                                            (1|office3) + (1|state) + 
                                                            (1|statedistrict) + 
                                                            (1|V101),
                                         data = subset(cces.uber, copartisan == 1))

mod.all.val.1.ordered.nopartisan <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                            cong_extra + cong_agree + 
                                                            cong_emoti +
                                                            (1|office3) + (1|state) + 
                                                            (1|statedistrict) + 
                                                            (1|V101),
                                         data = subset(cces.uber, copartisan == 0))

mod.all.val.1.ordered.lowinfo <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                         cong_extra + cong_agree + 
                                                         cong_emoti +
                                                         (1|office3) + (1|state) + 
                                                         (1|statedistrict) + (1|V101),
                                      data = subset(cces.uber, 
                                                    scaled_info < median(cces.uber$scaled_info, 
                                                                         na.rm = TRUE)))

mod.all.val.1.ordered.highinfo <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                          cong_extra + cong_agree + 
                                                          cong_emoti +
                                                          (1|office3) + (1|state) + 
                                                          (1|statedistrict) + (1|V101),
                                       data = subset(cces.uber, 
                                                     scaled_info >= median(cces.uber$scaled_info,
                                                                           na.rm = TRUE)))

mod.rep.val.1.ordered <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                 cong_extra + cong_agree + 
                                                 cong_emoti +
                                                 (1|state) + (1|statedistrict),
                              data = cces.rep)

mod.rep.val.1.ordered.copartisan <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                            cong_extra + cong_agree + 
                                                            cong_emoti +
                                                            (1|state) + (1|statedistrict),
                                         data = subset(cces.rep, copartisan == 1))

mod.rep.val.1.ordered.nopartisan <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                            cong_extra + cong_agree + 
                                                            cong_emoti +
                                                            (1|state) + (1|statedistrict),
                                         data = subset(cces.rep, copartisan == 0))

mod.rep.val.1.ordered.lowinfo <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                         cong_extra + cong_agree + 
                                                         cong_emoti +
                                                         (1|state) + (1|statedistrict),
                                      data = subset(cces.rep, 
                                                    scaled_info < median(cces.rep$scaled_info, 
                                                                         na.rm = TRUE)))

mod.rep.val.1.ordered.highinfo <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                          cong_extra + cong_agree + 
                                                          cong_emoti +
                                                          (1|state) + (1|statedistrict),
                                       data = subset(cces.rep, 
                                                     scaled_info >= median(cces.rep$scaled_info, 
                                                                           na.rm = TRUE)))

mod.sen.val.1.ordered <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                 cong_extra + cong_agree + 
                                                 cong_emoti +
                                                 (1|state) + (1|statedistrict),
                              data = cces.sen)

mod.sen.val.1.ordered.nopartisan <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                            cong_extra + cong_agree + 
                                                            cong_emoti +
                                                            (1|state) + (1|statedistrict),
                                         data = subset(cces.sen, copartisan == 0))

mod.sen.val.1.ordered.copartisan <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                            cong_extra + cong_agree + 
                                                            cong_emoti +
                                                            (1|state) + (1|statedistrict),
                                         data = subset(cces.sen, copartisan == 1))

mod.sen.val.1.ordered.lowinfo <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                         cong_extra + cong_agree + 
                                                         cong_emoti +
                                                         (1|state) + (1|statedistrict),
                                      data = subset(cces.sen, 
                                                    scaled_info < median(cces.sen$scaled_info, 
                                                                         na.rm = TRUE)))

mod.sen.val.1.ordered.highinfo <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                          cong_extra + cong_agree + 
                                                          cong_emoti +
                                                          (1|state) + (1|statedistrict),
                                       data = subset(cces.sen, 
                                                     scaled_info >= median(cces.sen$scaled_info, 
                                                                           na.rm = TRUE)))

mod.all.con.1.ordered <- clmm(factor(cong_app) ~ I(abs(cong_openn - self_openn)) + 
                                                 I(abs(cong_consc - self_consc)) + 
                                                 I(abs(cong_extra - self_extra)) +
                                                 I(abs(cong_agree - self_agree)) + 
                                                 I(abs(cong_emoti - self_emoti)) +
                                                 (1|office3) + (1|state) + 
                                                 (1|statedistrict) + (1|V101),
                              data = cces.uber)


mod.all.con.1.ordered.copartisan <- clmm(factor(cong_app) ~ I(abs(cong_openn - self_openn)) + 
                                                            I(abs(cong_consc - self_consc)) + 
                                                            I(abs(cong_extra - self_extra)) +
                                                            I(abs(cong_agree - self_agree)) + 
                                                            I(abs(cong_emoti - self_emoti)) +
                                                            (1|office3) + (1|state) + 
                                                            (1|statedistrict) + (1|V101),
                                         data = subset(cces.uber, copartisan == 1))

mod.all.con.1.ordered.nopartisan <- clmm(factor(cong_app) ~ I(abs(cong_openn - self_openn)) + 
                                                            I(abs(cong_consc - self_consc)) + 
                                                            I(abs(cong_extra - self_extra)) +
                                                            I(abs(cong_agree - self_agree)) + 
                                                            I(abs(cong_emoti - self_emoti)) +
                                                            (1|office3) + (1|state) + 
                                                            (1|statedistrict) + (1|V101),
                                         data = subset(cces.uber, copartisan == 0))

mod.all.con.1.ordered.lowinfo <- clmm(factor(cong_app) ~ I(abs(cong_openn - self_openn)) + 
                                                         I(abs(cong_consc - self_consc)) + 
                                                         I(abs(cong_extra - self_extra)) +
                                                         I(abs(cong_agree - self_agree)) + 
                                                         I(abs(cong_emoti - self_emoti)) +
                                                         (1|office3) + (1|state) + 
                                                         (1|statedistrict) + (1|V101),
                                      data = subset(cces.uber, 
                                                    scaled_info < median(cces.uber$scaled_info, 
                                                                         na.rm = TRUE)))

mod.all.con.1.ordered.highinfo <- clmm(factor(cong_app) ~ I(abs(cong_openn - self_openn)) + 
                                                          I(abs(cong_consc - self_consc)) + 
                                                          I(abs(cong_extra - self_extra)) +
                                                          I(abs(cong_agree - self_agree)) + 
                                                          I(abs(cong_emoti - self_emoti)) +
                                                          (1|office3) + (1|state) + 
                                                          (1|statedistrict) + (1|V101),
                                       data = subset(cces.uber, 
                                                     scaled_info >= median(cces.uber$scaled_info, 
                                                                           na.rm = TRUE)))

mod.rep.con.1.ordered <- clmm(factor(cong_app) ~ I(abs(cong_openn - self_openn)) + 
                                                 I(abs(cong_consc - self_consc)) + 
                                                 I(abs(cong_extra - self_extra)) +
                                                 I(abs(cong_agree - self_agree)) + 
                                                 I(abs(cong_emoti - self_emoti)) +
                                                 (1|state) + (1|statedistrict),
                              data = cces.rep)

mod.rep.con.1.ordered.copartisan <- clmm(factor(cong_app) ~ I(abs(cong_openn - self_openn)) + 
                                                            I(abs(cong_consc - self_consc)) + 
                                                            I(abs(cong_extra - self_extra)) +
                                                            I(abs(cong_agree - self_agree)) + 
                                                            I(abs(cong_emoti - self_emoti)) +
                                                            (1|state) + (1|statedistrict),
                                         data = subset(cces.rep, copartisan == 1))

mod.rep.con.1.ordered.nopartisan <- clmm(factor(cong_app) ~ I(abs(cong_openn - self_openn)) + 
                                                            I(abs(cong_consc - self_consc)) + 
                                                            I(abs(cong_extra - self_extra)) +
                                                            I(abs(cong_agree - self_agree)) + 
                                                            I(abs(cong_emoti - self_emoti)) +
                                                            (1|state) + (1|statedistrict),
                                         data = subset(cces.rep, copartisan == 0))

mod.rep.con.1.ordered.lowinfo <- clmm(factor(cong_app) ~ I(abs(cong_openn - self_openn)) + 
                                                         I(abs(cong_consc - self_consc)) + 
                                                         I(abs(cong_extra - self_extra)) +
                                                         I(abs(cong_agree - self_agree)) + 
                                                         I(abs(cong_emoti - self_emoti)) +
                                                         (1|state) + (1|statedistrict),
                                      data = subset(cces.rep, 
                                                    scaled_info < median(cces.rep$scaled_info, 
                                                                         na.rm = TRUE)))

mod.rep.con.1.ordered.highinfo <- clmm(factor(cong_app) ~ I(abs(cong_openn - self_openn)) + 
                                                          I(abs(cong_consc - self_consc)) + 
                                                          I(abs(cong_extra - self_extra)) +
                                                          I(abs(cong_agree - self_agree)) + 
                                                          I(abs(cong_emoti - self_emoti)) +
                                                          (1|state) + (1|statedistrict),
                                       data = subset(cces.rep, 
                                                     scaled_info >= median(cces.rep$scaled_info, 
                                                                           na.rm = TRUE)))

mod.sen.con.1.ordered <- clmm(factor(cong_app) ~ I(abs(cong_openn - self_openn)) + 
                                                 I(abs(cong_consc - self_consc)) + 
                                                 I(abs(cong_extra - self_extra)) +
                                                 I(abs(cong_agree - self_agree)) + 
                                                 I(abs(cong_emoti - self_emoti)) +
                                                 (1|state) + (1|statedistrict),
                              data = cces.sen)

mod.sen.con.1.ordered.copartisan <- clmm(factor(cong_app) ~ I(abs(cong_openn - self_openn)) + 
                                                            I(abs(cong_consc - self_consc)) + 
                                                            I(abs(cong_extra - self_extra)) +
                                                            I(abs(cong_agree - self_agree)) + 
                                                            I(abs(cong_emoti - self_emoti)) +
                                                            (1|state) + (1|statedistrict),
                                         data = subset(cces.sen, copartisan == 1))

mod.sen.con.1.ordered.nopartisan <- clmm(factor(cong_app) ~ I(abs(cong_openn - self_openn)) + 
                                                            I(abs(cong_consc - self_consc)) + 
                                                            I(abs(cong_extra - self_extra)) +
                                                            I(abs(cong_agree - self_agree)) + 
                                                            I(abs(cong_emoti - self_emoti)) +
                                                            (1|state) + (1|statedistrict),
                                         data = subset(cces.sen, copartisan == 0))

mod.sen.con.1.ordered.lowinfo <- clmm(factor(cong_app) ~ I(abs(cong_openn - self_openn)) + 
                                                         I(abs(cong_consc - self_consc)) + 
                                                         I(abs(cong_extra - self_extra)) +
                                                         I(abs(cong_agree - self_agree)) + 
                                                         I(abs(cong_emoti - self_emoti)) +
                                                         (1|state) + (1|statedistrict),
                                      data = subset(cces.sen, 
                                                    scaled_info < median(cces.sen$scaled_info, 
                                                                         na.rm = TRUE)))

mod.sen.con.1.ordered.highinfo <- clmm(factor(cong_app) ~ I(abs(cong_openn - self_openn)) + 
                                                          I(abs(cong_consc - self_consc)) + 
                                                          I(abs(cong_extra - self_extra)) +
                                                          I(abs(cong_agree - self_agree)) + 
                                                          I(abs(cong_emoti - self_emoti)) +
                                                          (1|state) + (1|statedistrict),
                                       data = subset(cces.sen, 
                                                     scaled_info >= median(cces.sen$scaled_info, 
                                                                           na.rm = TRUE)))

mod.all.big.1.ordered <- clmm(factor(cong_app) ~ cong_openn + cong_consc + cong_extra + 
                                                 cong_agree + cong_emoti +
                                                 I(abs(cong_openn - self_openn)) + 
                                                 I(abs(cong_consc - self_consc)) + 
                                                 I(abs(cong_extra - self_extra)) +
                                                 I(abs(cong_agree - self_agree)) + 
                                                 I(abs(cong_emoti - self_emoti)) +
                                                 (1|office3) + (1|state) + 
                                                 (1|statedistrict) + (1|V101),
                              data = cces.uber)

mod.all.big.1.ordered.copartisan <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                            cong_extra + cong_agree + 
                                                            cong_emoti +
                                                            I(abs(cong_openn - self_openn)) + 
                                                            I(abs(cong_consc - self_consc)) + 
                                                            I(abs(cong_extra - self_extra)) +
                                                            I(abs(cong_agree - self_agree)) + 
                                                            I(abs(cong_emoti - self_emoti)) +
                                                            (1|office3) + (1|state) + 
                                                            (1|statedistrict) + (1|V101),
                                         data = subset(cces.uber, copartisan == 1))

mod.all.big.1.ordered.nopartisan <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                            cong_extra + cong_agree + 
                                                            cong_emoti +
                                                            I(abs(cong_openn - self_openn)) + 
                                                            I(abs(cong_consc - self_consc)) + 
                                                            I(abs(cong_extra - self_extra)) +
                                                            I(abs(cong_agree - self_agree)) + 
                                                            I(abs(cong_emoti - self_emoti)) +
                                                            (1|office3) + (1|state) + 
                                                            (1|statedistrict) + (1|V101),
                                         data = subset(cces.uber, copartisan == 0))

mod.all.big.1.ordered.lowinfo <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                         cong_extra + cong_agree + 
                                                         cong_emoti +
                                                         I(abs(cong_openn - self_openn)) + 
                                                         I(abs(cong_consc - self_consc)) + 
                                                         I(abs(cong_extra - self_extra)) +
                                                         I(abs(cong_agree - self_agree)) + 
                                                         I(abs(cong_emoti - self_emoti)) +
                                                         (1|office3) + (1|state) + 
                                                         (1|statedistrict) + (1|V101),
                                      data = subset(cces.uber, 
                                                    scaled_info < median(cces.uber$scaled_info, 
                                                                         na.rm = TRUE)))

mod.all.big.1.ordered.highinfo <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                          cong_extra + cong_agree + 
                                                          cong_emoti +
                                                          I(abs(cong_openn - self_openn)) + 
                                                          I(abs(cong_consc - self_consc)) + 
                                                          I(abs(cong_extra - self_extra)) +
                                                          I(abs(cong_agree - self_agree)) + 
                                                          I(abs(cong_emoti - self_emoti)) +
                                                          (1|office3) + (1|state) + 
                                                          (1|statedistrict) + (1|V101),
                                       data = subset(cces.uber, 
                                                     scaled_info >= median(cces.uber$scaled_info, 
                                                                           na.rm = TRUE)))

mod.rep.big.1.ordered <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                 cong_extra + cong_agree + 
                                                 cong_emoti +
                                                 I(abs(cong_openn - self_openn)) + 
                                                 I(abs(cong_consc - self_consc)) + 
                                                 I(abs(cong_extra - self_extra)) +
                                                 I(abs(cong_agree - self_agree)) + 
                                                 I(abs(cong_emoti - self_emoti)) +
                                                 (1|state) + (1|statedistrict),
                              data = cces.rep)

mod.rep.big.1.ordered.copartisan <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                            cong_extra + cong_agree + 
                                                            cong_emoti +
                                                            I(abs(cong_openn - self_openn)) + 
                                                            I(abs(cong_consc - self_consc)) + 
                                                            I(abs(cong_extra - self_extra)) +
                                                            I(abs(cong_agree - self_agree)) + 
                                                            I(abs(cong_emoti - self_emoti)) +
                                                            (1|state) + (1|statedistrict),
                                         data = subset(cces.rep, copartisan == 1))

mod.rep.big.1.ordered.nopartisan <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                            cong_extra + cong_agree + 
                                                            cong_emoti +
                                                            I(abs(cong_openn - self_openn)) + 
                                                            I(abs(cong_consc - self_consc)) + 
                                                            I(abs(cong_extra - self_extra)) +
                                                            I(abs(cong_agree - self_agree)) + 
                                                            I(abs(cong_emoti - self_emoti)) +
                                                            (1|state) + (1|statedistrict),
                                         data = subset(cces.rep, copartisan == 0))

mod.rep.big.1.ordered.lowinfo <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                         cong_extra + cong_agree + 
                                                         cong_emoti +
                                                         I(abs(cong_openn - self_openn)) + 
                                                         I(abs(cong_consc - self_consc)) + 
                                                         I(abs(cong_extra - self_extra)) +
                                                         I(abs(cong_agree - self_agree)) + 
                                                         I(abs(cong_emoti - self_emoti)) +
                                                         (1|state) + (1|statedistrict),
                                      data = subset(cces.rep, 
                                                    scaled_info < median(cces.rep$scaled_info, 
                                                                         na.rm = TRUE)))

mod.rep.big.1.ordered.highinfo <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                          cong_extra + cong_agree + 
                                                          cong_emoti +
                                                          I(abs(cong_openn - self_openn)) + 
                                                          I(abs(cong_consc - self_consc)) + 
                                                          I(abs(cong_extra - self_extra)) +
                                                          I(abs(cong_agree - self_agree)) + 
                                                          I(abs(cong_emoti - self_emoti)) +
                                                          (1|state) + (1|statedistrict),
                                       data = subset(cces.rep, 
                                                     scaled_info >= median(cces.rep$scaled_info, 
                                                                           na.rm = TRUE)))

mod.sen.big.1.ordered <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                 cong_extra + cong_agree + 
                                                 cong_emoti +
                                                 I(abs(cong_openn - self_openn)) + 
                                                 I(abs(cong_consc - self_consc)) + 
                                                 I(abs(cong_extra - self_extra)) +
                                                 I(abs(cong_agree - self_agree)) + 
                                                 I(abs(cong_emoti - self_emoti)) +
                                                 (1|state) + (1|statedistrict),
                              data = cces.sen)

mod.sen.big.1.ordered.copartisan <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                            cong_extra + cong_agree + 
                                                            cong_emoti +
                                                            I(abs(cong_openn - self_openn)) + 
                                                            I(abs(cong_consc - self_consc)) + 
                                                            I(abs(cong_extra - self_extra)) +
                                                            I(abs(cong_agree - self_agree)) + 
                                                            I(abs(cong_emoti - self_emoti)) +
                                                            (1|state) + (1|statedistrict),
                                         data = subset(cces.sen, copartisan == 1))

mod.sen.big.1.ordered.nopartisan <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                            cong_extra + cong_agree + 
                                                            cong_emoti +
                                                            I(abs(cong_openn - self_openn)) + 
                                                            I(abs(cong_consc - self_consc)) + 
                                                            I(abs(cong_extra - self_extra)) +
                                                            I(abs(cong_agree - self_agree)) + 
                                                            I(abs(cong_emoti - self_emoti)) +
                                                            (1|state) + (1|statedistrict),
                                         data = subset(cces.sen, copartisan == 0))

mod.sen.big.1.ordered.lowinfo <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                         cong_extra + cong_agree + 
                                                         cong_emoti +
                                                         I(abs(cong_openn - self_openn)) + 
                                                         I(abs(cong_consc - self_consc)) + 
                                                         I(abs(cong_extra - self_extra)) +
                                                         I(abs(cong_agree - self_agree)) + 
                                                         I(abs(cong_emoti - self_emoti)) +
                                                         (1|state) + (1|statedistrict),
                                      data = subset(cces.sen, 
                                                    scaled_info < median(cces.sen$scaled_info, 
                                                                         na.rm = TRUE)))

mod.sen.big.1.ordered.highinfo <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                          cong_extra + cong_agree + 
                                                          cong_emoti +
                                                          I(abs(cong_openn - self_openn)) + 
                                                          I(abs(cong_consc - self_consc)) + 
                                                          I(abs(cong_extra - self_extra)) +
                                                          I(abs(cong_agree - self_agree)) + 
                                                          I(abs(cong_emoti - self_emoti)) +
                                                          (1|state) + (1|statedistrict),
                                       data = subset(cces.sen, 
                                                     scaled_info >= median(cces.sen$scaled_info, 
                                                                           na.rm = TRUE)))

mod.all.val.2.ordered <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                 cong_extra + cong_agree + 
                                                 cong_emoti +
                                                 I(abs(respondent_AM - cong_AM)) +
                                                 (1|office3) + (1|state) + 
                                                 (1|statedistrict) + (1|V101),
                              data = cces.uber)

mod.all.val.2.ordered.copartisan <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                            cong_extra + cong_agree + 
                                                            cong_emoti +
                                                            I(abs(respondent_AM - cong_AM)) +
                                                            (1|office3) + (1|state) + 
                                                            (1|statedistrict) + (1|V101),
                                         data = subset(cces.uber, copartisan == 1))

mod.all.val.2.ordered.nopartisan <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                            cong_extra + cong_agree + 
                                                            cong_emoti +
                                                            I(abs(respondent_AM - cong_AM)) +
                                                            (1|office3) + (1|state) + 
                                                            (1|statedistrict) + (1|V101),
                                         data = subset(cces.uber, copartisan == 0))

mod.all.val.2.ordered.highinfo <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                          cong_extra + cong_agree + 
                                                          cong_emoti +
                                                          I(abs(respondent_AM - cong_AM)) +
                                                          (1|office3) + (1|state) + 
                                                          (1|statedistrict) + (1|V101),
                                       data = subset(cces.uber, 
                                                     scaled_info >= median(cces.uber$scaled_info, 
                                                                           na.rm = TRUE)))

mod.all.val.2.ordered.lowinfo <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                         cong_extra + cong_agree + 
                                                         cong_emoti +
                                                         I(abs(respondent_AM - cong_AM)) +
                                                         (1|office3) + (1|state) + 
                                                         (1|statedistrict) + (1|V101),
                                      data = subset(cces.uber, 
                                                    scaled_info < median(cces.uber$scaled_info, 
                                                                         na.rm = TRUE)))

mod.rep.val.2.ordered <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                 cong_extra + cong_agree + 
                                                 cong_emoti +
                                                 I(abs(respondent_AM - cong_AM)) +
                                                 (1|state) + (1|statedistrict),
                              data = cces.rep)

mod.rep.val.2.ordered.copartisan <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                            cong_extra + cong_agree + 
                                                            cong_emoti +
                                                            I(abs(respondent_AM - cong_AM)) +
                                                            (1|state) + (1|statedistrict),
                                         data = subset(cces.rep, copartisan == 1))

mod.rep.val.2.ordered.nopartisan <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                            cong_extra + cong_agree + 
                                                            cong_emoti +
                                                            I(abs(respondent_AM - cong_AM)) +
                                                            (1|state) + (1|statedistrict),
                                         data = subset(cces.rep, copartisan == 0))

mod.rep.val.2.ordered.lowinfo <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                         cong_extra + cong_agree + 
                                                         cong_emoti +
                                                         I(abs(respondent_AM - cong_AM)) +
                                                         (1|state) + (1|statedistrict),
                                      data = subset(cces.rep, 
                                                    scaled_info < median(cces.rep$scaled_info, 
                                                                         na.rm = TRUE)))

mod.rep.val.2.ordered.highinfo <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                          cong_extra + cong_agree + 
                                                          cong_emoti +
                                                          I(abs(respondent_AM - cong_AM)) +
                                                          (1|state) + (1|statedistrict),
                                       data = subset(cces.rep, 
                                                     scaled_info >= median(cces.rep$scaled_info, 
                                                                           na.rm = TRUE)))


mod.sen.val.2.ordered <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                 cong_extra + cong_agree + 
                                                 cong_emoti +
                                                 I(abs(respondent_AM - cong_AM)) +
                                                 (1|state) + (1|statedistrict),
                              data = cces.sen)

mod.sen.val.2.ordered.copartisan <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                            cong_extra + cong_agree + 
                                                            cong_emoti +
                                                            I(abs(respondent_AM - cong_AM)) +
                                                            (1|state) + (1|statedistrict),
                                         data = subset(cces.sen, copartisan == 1))

mod.sen.val.2.ordered.nopartisan <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                            cong_extra + cong_agree + 
                                                            cong_emoti +
                                                            I(abs(respondent_AM - cong_AM)) +
                                                            (1|state) + (1|statedistrict),
                                         data = subset(cces.sen, copartisan == 0))

mod.sen.val.2.ordered.highinfo <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                          cong_extra + cong_agree + 
                                                          cong_emoti +
                                                          I(abs(respondent_AM - cong_AM)) +
                                                          (1|state) + (1|statedistrict),
                                       data = subset(cces.sen, 
                                                     scaled_info >= median(cces.sen$scaled_info, 
                                                                           na.rm = TRUE)))

mod.sen.val.2.ordered.lowinfo <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                         cong_extra + cong_agree + 
                                                         cong_emoti +
                                                         I(abs(respondent_AM - cong_AM)) +
                                                         (1|state) + (1|statedistrict),
                                      data = subset(cces.sen, 
                                                    scaled_info < median(cces.sen$scaled_info, 
                                                                         na.rm = TRUE)))

mod.all.con.2.ordered <- clmm(factor(cong_app) ~ I(abs(cong_openn - self_openn)) + 
                                                 I(abs(cong_consc - self_consc)) + 
                                                 I(abs(cong_extra - self_extra)) +
                                                 I(abs(cong_agree - self_agree)) + 
                                                 I(abs(cong_emoti - self_emoti)) +
                                                 I(abs(respondent_AM - cong_AM)) +
                                                 (1|office3) + (1|state) + 
                                                 (1|statedistrict) + (1|V101),
                              data = cces.uber)

mod.all.con.2.ordered.copartisan <- clmm(factor(cong_app) ~ I(abs(cong_openn - self_openn)) + 
                                                            I(abs(cong_consc - self_consc)) + 
                                                            I(abs(cong_extra - self_extra)) +
                                                            I(abs(cong_agree - self_agree)) + 
                                                            I(abs(cong_emoti - self_emoti)) +
                                                            I(abs(respondent_AM - cong_AM)) +
                                                            (1|office3) + (1|state) + 
                                                            (1|statedistrict) + (1|V101),
                                         data = subset(cces.uber, copartisan == 1))

mod.all.con.2.ordered.nopartisan <- clmm(factor(cong_app) ~ I(abs(cong_openn - self_openn)) + 
                                                            I(abs(cong_consc - self_consc)) + 
                                                            I(abs(cong_extra - self_extra)) +
                                                            I(abs(cong_agree - self_agree)) + 
                                                            I(abs(cong_emoti - self_emoti)) +
                                                            I(abs(respondent_AM - cong_AM)) +
                                                            (1|office3) + (1|state) + 
                                                            (1|statedistrict) + (1|V101),
                                         data = subset(cces.uber, copartisan == 0))

mod.all.con.2.ordered.lowinfo <- clmm(factor(cong_app) ~ I(abs(cong_openn - self_openn)) + 
                                                         I(abs(cong_consc - self_consc)) + 
                                                         I(abs(cong_extra - self_extra)) +
                                                         I(abs(cong_agree - self_agree)) + 
                                                         I(abs(cong_emoti - self_emoti)) +
                                                         I(abs(respondent_AM - cong_AM)) +
                                                         (1|office3) + (1|state) + 
                                                         (1|statedistrict) + (1|V101),
                                      data = subset(cces.uber, 
                                                    scaled_info < median(cces.uber$scaled_info, 
                                                                         na.rm = TRUE)))

mod.all.con.2.ordered.highinfo <- clmm(factor(cong_app) ~ I(abs(cong_openn - self_openn)) + 
                                                          I(abs(cong_consc - self_consc)) + 
                                                          I(abs(cong_extra - self_extra)) +
                                                          I(abs(cong_agree - self_agree)) + 
                                                          I(abs(cong_emoti - self_emoti)) +
                                                          I(abs(respondent_AM - cong_AM)) +
                                                          (1|office3) + (1|state) + 
                                                          (1|statedistrict) + (1|V101),
                                       data = subset(cces.uber, 
                                                     scaled_info >= median(cces.uber$scaled_info, 
                                                                           na.rm = TRUE)))

mod.rep.con.2.ordered <- clmm(factor(cong_app) ~ I(abs(cong_openn - self_openn)) + 
                                                 I(abs(cong_consc - self_consc)) + 
                                                 I(abs(cong_extra - self_extra)) +
                                                 I(abs(cong_agree - self_agree)) + 
                                                 I(abs(cong_emoti - self_emoti)) +
                                                 I(abs(respondent_AM - cong_AM)) +
                                                 (1|state) + (1|statedistrict),
                              data = cces.rep)

mod.rep.con.2.ordered.copartisan <- clmm(factor(cong_app) ~ I(abs(cong_openn - self_openn)) + 
                                                            I(abs(cong_consc - self_consc)) + 
                                                            I(abs(cong_extra - self_extra)) +
                                                            I(abs(cong_agree - self_agree)) + 
                                                            I(abs(cong_emoti - self_emoti)) +
                                                            I(abs(respondent_AM - cong_AM)) +
                                                            (1|state) + (1|statedistrict),
                                         data = subset(cces.rep, copartisan == 1))

mod.rep.con.2.ordered.nopartisan <- clmm(factor(cong_app) ~ I(abs(cong_openn - self_openn)) + 
                                                            I(abs(cong_consc - self_consc)) + 
                                                            I(abs(cong_extra - self_extra)) +
                                                            I(abs(cong_agree - self_agree)) + 
                                                            I(abs(cong_emoti - self_emoti)) +
                                                            I(abs(respondent_AM - cong_AM)) +
                                                            (1|state) + (1|statedistrict),
                                         data = subset(cces.rep, copartisan == 0))

mod.rep.con.2.ordered.lowinfo <- clmm(factor(cong_app) ~ I(abs(cong_openn - self_openn)) + 
                                                         I(abs(cong_consc - self_consc)) + 
                                                         I(abs(cong_extra - self_extra)) +
                                                         I(abs(cong_agree - self_agree)) + 
                                                         I(abs(cong_emoti - self_emoti)) +
                                                         I(abs(respondent_AM - cong_AM)) +
                                                         (1|state) + (1|statedistrict),
                                      data = subset(cces.rep, 
                                                    scaled_info < median(cces.rep$scaled_info, 
                                                                         na.rm = TRUE)))

mod.rep.con.2.ordered.highinfo <- clmm(factor(cong_app) ~ I(abs(cong_openn - self_openn)) + 
                                                          I(abs(cong_consc - self_consc)) + 
                                                          I(abs(cong_extra - self_extra)) +
                                                          I(abs(cong_agree - self_agree)) + 
                                                          I(abs(cong_emoti - self_emoti)) +
                                                          I(abs(respondent_AM - cong_AM)) +
                                                          (1|state) + (1|statedistrict),
                                       data = subset(cces.rep, 
                                                     scaled_info >= median(cces.rep$scaled_info, 
                                                                           na.rm = TRUE)))

mod.sen.con.2.ordered <- clmm(factor(cong_app) ~ I(abs(cong_openn - self_openn)) + 
                                                 I(abs(cong_consc - self_consc)) + 
                                                 I(abs(cong_extra - self_extra)) +
                                                 I(abs(cong_agree - self_agree)) + 
                                                 I(abs(cong_emoti - self_emoti)) +
                                                 I(abs(respondent_AM - cong_AM)) +
                                                 (1|state) + (1|statedistrict),
                              data = cces.sen)

mod.sen.con.2.ordered.copartisan <- clmm(factor(cong_app) ~ I(abs(cong_openn - self_openn)) + 
                                                            I(abs(cong_consc - self_consc)) + 
                                                            I(abs(cong_extra - self_extra)) +
                                                            I(abs(cong_agree - self_agree)) + 
                                                            I(abs(cong_emoti - self_emoti)) +
                                                            I(abs(respondent_AM - cong_AM)) +
                                                            (1|state) + (1|statedistrict),
                                         data = subset(cces.sen, copartisan == 1))

mod.sen.con.2.ordered.nopartisan <- clmm(factor(cong_app) ~ I(abs(cong_openn - self_openn)) + 
                                                            I(abs(cong_consc - self_consc)) + 
                                                            I(abs(cong_extra - self_extra)) +
                                                            I(abs(cong_agree - self_agree)) + 
                                                            I(abs(cong_emoti - self_emoti)) +
                                                            I(abs(respondent_AM - cong_AM)) +
                                                            (1|state) + (1|statedistrict),
                                         data = subset(cces.sen, copartisan == 0))

mod.sen.con.2.ordered.lowinfo <- clmm(factor(cong_app) ~ I(abs(cong_openn - self_openn)) + 
                                                         I(abs(cong_consc - self_consc)) + 
                                                         I(abs(cong_extra - self_extra)) +
                                                         I(abs(cong_agree - self_agree)) + 
                                                         I(abs(cong_emoti - self_emoti)) +
                                                         I(abs(respondent_AM - cong_AM)) +
                                                         (1|state) + (1|statedistrict),
                                      data = subset(cces.sen, 
                                                    scaled_info < median(cces.sen$scaled_info, 
                                                                         na.rm = TRUE)))

mod.sen.con.2.ordered.highinfo <- clmm(factor(cong_app) ~ I(abs(cong_openn - self_openn)) + 
                                                          I(abs(cong_consc - self_consc)) + 
                                                          I(abs(cong_extra - self_extra)) +
                                                          I(abs(cong_agree - self_agree)) + 
                                                          I(abs(cong_emoti - self_emoti)) +
                                                          I(abs(respondent_AM - cong_AM)) +
                                                          (1|state) + (1|statedistrict),
                                       data = subset(cces.sen, 
                                                     scaled_info >= median(cces.sen$scaled_info, 
                                                                           na.rm = TRUE)))


mod.all.big.2.ordered <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                 cong_extra + cong_agree + 
                                                 cong_emoti +
                                                 I(abs(cong_openn - self_openn)) + 
                                                 I(abs(cong_consc - self_consc)) + 
                                                 I(abs(cong_extra - self_extra)) +
                                                 I(abs(cong_agree - self_agree)) + 
                                                 I(abs(cong_emoti - self_emoti)) +
                                                 I(abs(respondent_AM - cong_AM)) +
                                                 (1|office3)  + (1|state) + 
                                                 (1|statedistrict) + (1|V101),
                              data = cces.uber)

mod.all.big.2.ordered.copartisan <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                            cong_extra + cong_agree + 
                                                            cong_emoti +
                                                            I(abs(cong_openn - self_openn)) + 
                                                            I(abs(cong_consc - self_consc)) + 
                                                            I(abs(cong_extra - self_extra)) +
                                                            I(abs(cong_agree - self_agree)) + 
                                                            I(abs(cong_emoti - self_emoti)) +
                                                            I(abs(respondent_AM - cong_AM)) +
                                                            (1|office3)  + (1|state) + 
                                                            (1|statedistrict) + (1|V101),
                                         data = subset(cces.uber, copartisan == 1))

mod.all.big.2.ordered.nopartisan <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                            cong_extra + cong_agree + 
                                                            cong_emoti +
                                                            I(abs(cong_openn - self_openn)) + 
                                                            I(abs(cong_consc - self_consc)) + 
                                                            I(abs(cong_extra - self_extra)) +
                                                            I(abs(cong_agree - self_agree)) + 
                                                            I(abs(cong_emoti - self_emoti)) +
                                                            I(abs(respondent_AM - cong_AM)) +
                                                            (1|office3)  + (1|state) + 
                                                            (1|statedistrict) + (1|V101),
                                         data = subset(cces.uber, copartisan == 0))

mod.all.big.2.ordered.highinfo <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                          cong_extra + cong_agree + 
                                                          cong_emoti +
                                                          I(abs(cong_openn - self_openn)) + 
                                                          I(abs(cong_consc - self_consc)) + 
                                                          I(abs(cong_extra - self_extra)) +
                                                          I(abs(cong_agree - self_agree)) + 
                                                          I(abs(cong_emoti - self_emoti)) +
                                                          I(abs(respondent_AM - cong_AM)) +
                                                          (1|office3)  + (1|state) + 
                                                          (1|statedistrict) + (1|V101),
                                       data = subset(cces.uber, 
                                                     scaled_info >= median(cces.uber$scaled_info, 
                                                                           na.rm = TRUE)))

mod.all.big.2.ordered.lowinfo <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                         cong_extra + cong_agree + 
                                                         cong_emoti +
                                                         I(abs(cong_openn - self_openn)) + 
                                                         I(abs(cong_consc - self_consc)) + 
                                                         I(abs(cong_extra - self_extra)) +
                                                         I(abs(cong_agree - self_agree)) + 
                                                         I(abs(cong_emoti - self_emoti)) +
                                                         I(abs(respondent_AM - cong_AM)) +
                                                         (1|office3)  + (1|state) + 
                                                         (1|statedistrict) + (1|V101),
                                      data = subset(cces.uber, 
                                                    scaled_info < median(cces.uber$scaled_info, 
                                                                         na.rm = TRUE)))


mod.rep.big.2.ordered <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                 cong_extra + cong_agree + 
                                                 cong_emoti +
                                                 I(abs(cong_openn - self_openn)) + 
                                                 I(abs(cong_consc - self_consc)) + 
                                                 I(abs(cong_extra - self_extra)) +
                                                 I(abs(cong_agree - self_agree)) + 
                                                 I(abs(cong_emoti - self_emoti)) +
                                                 I(abs(respondent_AM - cong_AM)) +
                                                 (1|state) + (1|statedistrict),
                              data = cces.rep)

mod.rep.big.2.ordered.copartisan <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                            cong_extra + cong_agree + 
                                                            cong_emoti +
                                                            I(abs(cong_openn - self_openn)) + 
                                                            I(abs(cong_consc - self_consc)) + 
                                                            I(abs(cong_extra - self_extra)) +
                                                            I(abs(cong_agree - self_agree)) + 
                                                            I(abs(cong_emoti - self_emoti)) +
                                                            I(abs(respondent_AM - cong_AM)) +
                                                            (1|state) + (1|statedistrict),
                                         data = subset(cces.rep, copartisan == 1))

mod.rep.big.2.ordered.nopartisan <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                            cong_extra + cong_agree + 
                                                            cong_emoti +
                                                            I(abs(cong_openn - self_openn)) + 
                                                            I(abs(cong_consc - self_consc)) + 
                                                            I(abs(cong_extra - self_extra)) +
                                                            I(abs(cong_agree - self_agree)) + 
                                                            I(abs(cong_emoti - self_emoti)) +
                                                            I(abs(respondent_AM - cong_AM)) +
                                                            (1|state) + (1|statedistrict),
                                         data = subset(cces.rep, copartisan == 0))

mod.rep.big.2.ordered.lowinfo <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                         cong_extra + cong_agree + 
                                                         cong_emoti +
                                                         I(abs(cong_openn - self_openn)) + 
                                                         I(abs(cong_consc - self_consc)) + 
                                                         I(abs(cong_extra - self_extra)) +
                                                         I(abs(cong_agree - self_agree)) + 
                                                         I(abs(cong_emoti - self_emoti)) +
                                                         I(abs(respondent_AM - cong_AM)) +
                                                         (1|state) + (1|statedistrict),
                                      data = subset(cces.rep, 
                                                    scaled_info < median(cces.rep$scaled_info, 
                                                                         na.rm = TRUE)))

mod.rep.big.2.ordered.highinfo <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                          cong_extra + cong_agree + 
                                                          cong_emoti +
                                                          I(abs(cong_openn - self_openn)) + 
                                                          I(abs(cong_consc - self_consc)) + 
                                                          I(abs(cong_extra - self_extra)) +
                                                          I(abs(cong_agree - self_agree)) + 
                                                          I(abs(cong_emoti - self_emoti)) +
                                                          I(abs(respondent_AM - cong_AM)) +
                                                          (1|state) + (1|statedistrict),
                                       data = subset(cces.rep, 
                                                     scaled_info >= median(cces.rep$scaled_info, 
                                                                           na.rm = TRUE)))


mod.sen.big.2.ordered <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                 cong_extra + cong_agree + 
                                                 cong_emoti +
                                                 I(abs(cong_openn - self_openn)) + 
                                                 I(abs(cong_consc - self_consc)) + 
                                                 I(abs(cong_extra - self_extra)) +
                                                 I(abs(cong_agree - self_agree)) + 
                                                 I(abs(cong_emoti - self_emoti)) +
                                                 I(abs(respondent_AM - cong_AM)) +
                                                 (1|state) + (1|statedistrict),
                              data = cces.sen)

mod.sen.big.2.ordered.copartisan <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                            cong_extra + cong_agree + 
                                                            cong_emoti +
                                                            I(abs(cong_openn - self_openn)) + 
                                                            I(abs(cong_consc - self_consc)) + 
                                                            I(abs(cong_extra - self_extra)) +
                                                            I(abs(cong_agree - self_agree)) + 
                                                            I(abs(cong_emoti - self_emoti)) +
                                                            I(abs(respondent_AM - cong_AM)) +
                                                            (1|state) + (1|statedistrict),
                                         data = subset(cces.sen, copartisan == 1))

mod.sen.big.2.ordered.nopartisan <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                            cong_extra + cong_agree + 
                                                            cong_emoti +
                                                            I(abs(cong_openn - self_openn)) + 
                                                            I(abs(cong_consc - self_consc)) + 
                                                            I(abs(cong_extra - self_extra)) +
                                                            I(abs(cong_agree - self_agree)) + 
                                                            I(abs(cong_emoti - self_emoti)) +
                                                            I(abs(respondent_AM - cong_AM)) +
                                                            (1|state) + (1|statedistrict),
                                         data = subset(cces.sen, copartisan == 0))

mod.sen.big.2.ordered.lowinfo <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                         cong_extra + cong_agree + 
                                                         cong_emoti +
                                                         I(abs(cong_openn - self_openn)) + 
                                                         I(abs(cong_consc - self_consc)) + 
                                                         I(abs(cong_extra - self_extra)) +
                                                         I(abs(cong_agree - self_agree)) + 
                                                         I(abs(cong_emoti - self_emoti)) +
                                                         I(abs(respondent_AM - cong_AM)) +
                                                         (1|state) + (1|statedistrict),
                                      data = subset(cces.sen, 
                                                    scaled_info < median(cces.sen$scaled_info, 
                                                                         na.rm = TRUE)))

mod.sen.big.2.ordered.highinfo <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                          cong_extra + cong_agree + 
                                                          cong_emoti +
                                                          I(abs(cong_openn - self_openn)) + 
                                                          I(abs(cong_consc - self_consc)) + 
                                                          I(abs(cong_extra - self_extra)) +
                                                          I(abs(cong_agree - self_agree)) + 
                                                          I(abs(cong_emoti - self_emoti)) +
                                                          I(abs(respondent_AM - cong_AM)) +
                                                          (1|state) + (1|statedistrict),
                                       data = subset(cces.sen, 
                                                     scaled_info >= median(cces.sen$scaled_info, 
                                                                           na.rm = TRUE)))

mod.all.val.3.ordered <- clmm(factor(cong_app) ~ (respondent_AM + 
                                                  I(abs(respondent_AM)))*(cong_openn + 
                                                                          cong_consc + 
                                                                          cong_extra + 
                                                                          cong_agree + 
                                                                          cong_emoti) +
                                                 I(abs(respondent_AM - cong_AM)) +
                                                 (1|office3) + (1|state) + 
                                                 (1|statedistrict) + (1|V101),
                              data = cces.uber)

mod.all.val.3.ordered.copartisan <- clmm(factor(cong_app) ~ (respondent_AM + 
                                                             I(abs(respondent_AM)))*(cong_openn + 
                                                                                     cong_consc + 
                                                                                     cong_extra + 
                                                                                     cong_agree + 
                                                                                     cong_emoti) +
                                                            I(abs(respondent_AM - cong_AM)) +
                                                            (1|office3) + (1|state) + 
                                                            (1|statedistrict) + (1|V101),
                                         data = subset(cces.uber, copartisan == 1))

mod.all.val.3.ordered.nopartisan <- clmm(factor(cong_app) ~ (respondent_AM + 
                                                             I(abs(respondent_AM)))*(cong_openn + 
                                                                                     cong_consc + 
                                                                                     cong_extra + 
                                                                                     cong_agree + 
                                                                                     cong_emoti) +
                                                            I(abs(respondent_AM - cong_AM)) +
                                                            (1|office3) + (1|state) + 
                                                            (1|statedistrict) + (1|V101),
                                         data = subset(cces.uber, copartisan == 0))

mod.all.val.3.ordered.lowinfo <- clmm(factor(cong_app) ~ (respondent_AM + 
                                                          I(abs(respondent_AM)))*(cong_openn + 
                                                                                  cong_consc + 
                                                                                  cong_extra + 
                                                                                  cong_agree + 
                                                                                  cong_emoti) +
                                                         I(abs(respondent_AM - cong_AM)) +
                                                         (1|office3) + (1|state) + 
                                                         (1|statedistrict) + (1|V101),
                                      data = subset(cces.uber, 
                                                    scaled_info < median(cces.uber$scaled_info, 
                                                                         na.rm = TRUE)))

mod.all.val.3.ordered.highinfo <- clmm(factor(cong_app) ~ (respondent_AM + 
                                                           I(abs(respondent_AM)))*(cong_openn + 
                                                                                   cong_consc + 
                                                                                   cong_extra + 
                                                                                   cong_agree + 
                                                                                   cong_emoti) +
                                                          I(abs(respondent_AM - cong_AM)) +
                                                          (1|office3) + (1|state) + 
                                                          (1|statedistrict) + (1|V101),
                                       data = subset(cces.uber, 
                                                     scaled_info >= median(cces.uber$scaled_info, 
                                                                           na.rm = TRUE)))


mod.rep.val.3.ordered <- clmm(factor(cong_app) ~ (respondent_AM + 
                                                  I(abs(respondent_AM)))*(cong_openn + 
                                                                          cong_consc + 
                                                                          cong_extra + 
                                                                          cong_agree + 
                                                                          cong_emoti) +
                                                  I(abs(respondent_AM - cong_AM)) +
                                                  (1|state) + (1|statedistrict),
                              data = cces.rep)

mod.rep.val.3.ordered.copartisan <- clmm(factor(cong_app) ~ (respondent_AM + 
                                                             I(abs(respondent_AM)))*(cong_openn + 
                                                                                     cong_consc + 
                                                                                     cong_extra + 
                                                                                     cong_agree + 
                                                                                     cong_emoti) +
                                                            I(abs(respondent_AM - cong_AM)) +
                                                            (1|state) + (1|statedistrict),
                                         data = subset(cces.rep, copartisan == 1))

mod.rep.val.3.ordered.nopartisan <- clmm(factor(cong_app) ~ (respondent_AM + 
                                                             I(abs(respondent_AM)))*(cong_openn + 
                                                                                     cong_consc + 
                                                                                     cong_extra + 
                                                                                     cong_agree + 
                                                                                     cong_emoti) +
                                                            I(abs(respondent_AM - cong_AM)) +
                                                            (1|state) + (1|statedistrict),
                                         data = subset(cces.rep, copartisan == 0))

mod.rep.val.3.ordered.lowinfo <- clmm(factor(cong_app) ~ (respondent_AM + 
                                                          I(abs(respondent_AM)))*(cong_openn + 
                                                                                  cong_consc + 
                                                                                  cong_extra + 
                                                                                  cong_agree + 
                                                                                  cong_emoti) +
                                                         I(abs(respondent_AM - cong_AM)) +
                                                         (1|state) + (1|statedistrict),
                                      data = subset(cces.rep, 
                                                    scaled_info < median(cces.rep$scaled_info, 
                                                                         na.rm = TRUE)))

mod.rep.val.3.ordered.highinfo <- clmm(factor(cong_app) ~ (respondent_AM + 
                                                           I(abs(respondent_AM)))*(cong_openn + 
                                                                                   cong_consc + 
                                                                                   cong_extra + 
                                                                                   cong_agree + 
                                                                                   cong_emoti) +
                                                          I(abs(respondent_AM - cong_AM)) +
                                                          (1|state) + (1|statedistrict),
                                       data = subset(cces.rep, 
                                                     scaled_info >= median(cces.rep$scaled_info, 
                                                                           na.rm = TRUE)))


mod.sen.val.3.ordered <- clmm(factor(cong_app) ~ (respondent_AM + 
                                                  I(abs(respondent_AM)))*(cong_openn + 
                                                                          cong_consc + 
                                                                          cong_extra +
                                                                          cong_agree + 
                                                                          cong_emoti) +
                                                 I(abs(respondent_AM - cong_AM)) +
                                                 (1|state) + (1|statedistrict),
                              data = cces.sen)

mod.sen.val.3.ordered.copartisan <- clmm(factor(cong_app) ~ (respondent_AM + 
                                                             I(abs(respondent_AM)))*(cong_openn + 
                                                                                     cong_consc + 
                                                                                     cong_extra + 
                                                                                     cong_agree + 
                                                                                     cong_emoti) +
                                                            I(abs(respondent_AM - cong_AM)) +
                                                            (1|state) + (1|statedistrict),
                                         data = subset(cces.sen, copartisan == 1))

mod.sen.val.3.ordered.nopartisan <- clmm(factor(cong_app) ~ (respondent_AM + 
                                                             I(abs(respondent_AM)))*(cong_openn + 
                                                                                     cong_consc + 
                                                                                     cong_extra + 
                                                                                     cong_agree + 
                                                                                     cong_emoti) +
                                                            I(abs(respondent_AM - cong_AM)) +
                                                            (1|state) + (1|statedistrict),
                                         data = subset(cces.sen, copartisan == 0))

mod.sen.val.3.ordered.lowinfo <- clmm(factor(cong_app) ~ (respondent_AM + 
                                                          I(abs(respondent_AM)))*(cong_openn + 
                                                                                  cong_consc + 
                                                                                  cong_extra + 
                                                                                  cong_agree + 
                                                                                  cong_emoti) +
                                                         I(abs(respondent_AM - cong_AM)) +
                                                         (1|state) + (1|statedistrict),
                                      data = subset(cces.sen, 
                                                    scaled_info < median(cces.sen$scaled_info, 
                                                                         na.rm = TRUE)))

mod.sen.val.3.ordered.highinfo <- clmm(factor(cong_app) ~ (respondent_AM + 
                                                           I(abs(respondent_AM)))*(cong_openn + 
                                                                                   cong_consc + 
                                                                                   cong_extra + 
                                                                                   cong_agree + 
                                                                                   cong_emoti) +
                                                          I(abs(respondent_AM - cong_AM)) +
                                                          (1|state) + (1|statedistrict),
                                       data = subset(cces.sen, 
                                                     scaled_info >= median(cces.sen$scaled_info, 
                                                                           na.rm = TRUE)))


mod.all.con.3.ordered <- clmm(factor(cong_app) ~ (respondent_AM + 
                                                  I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) + 
                                                                          I(abs(cong_consc - self_consc)) + 
                                                                          I(abs(cong_extra - self_extra)) +
                                                                          I(abs(cong_agree - self_agree)) + 
                                                                          I(abs(cong_emoti - self_emoti))) +
                                                 I(abs(respondent_AM - cong_AM)) +
                                                 (1|office3) + (1|state) + 
                                                 (1|statedistrict) + (1|V101),
                              data = cces.uber)

mod.all.con.3.ordered.copartisan <- clmm(factor(cong_app) ~ (respondent_AM + 
                                                             I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) + 
                                                                                     I(abs(cong_consc - self_consc)) + 
                                                                                     I(abs(cong_extra - self_extra)) +
                                                                                     I(abs(cong_agree - self_agree)) + 
                                                                                     I(abs(cong_emoti - self_emoti))) +
                                                            I(abs(respondent_AM - cong_AM)) +
                                                            (1|office3) + (1|state) + 
                                                            (1|statedistrict) + (1|V101),
                                         data = subset(cces.uber, copartisan == 1))

mod.all.con.3.ordered.nopartisan <- clmm(factor(cong_app) ~ (respondent_AM + 
                                                             I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) + 
                                                                                     I(abs(cong_consc - self_consc)) + 
                                                                                     I(abs(cong_extra - self_extra)) +
                                                                                     I(abs(cong_agree - self_agree)) + 
                                                                                     I(abs(cong_emoti - self_emoti))) +
                                                            I(abs(respondent_AM - cong_AM)) +
                                                            (1|office3) + (1|state) + 
                                                            (1|statedistrict) + (1|V101),
                                         data = subset(cces.uber, copartisan == 0))

mod.all.con.3.ordered.lowinfo <- clmm(factor(cong_app) ~ (respondent_AM + 
                                                          I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) + 
                                                                                  I(abs(cong_consc - self_consc)) + 
                                                                                  I(abs(cong_extra - self_extra)) +
                                                                                  I(abs(cong_agree - self_agree)) + 
                                                                                  I(abs(cong_emoti - self_emoti))) +
                                                         I(abs(respondent_AM - cong_AM)) +
                                                         (1|office3) + (1|state) + 
                                                         (1|statedistrict) + (1|V101),
                                      data = subset(cces.uber, 
                                                    scaled_info < median(cces.uber$scaled_info, 
                                                                         na.rm = TRUE)))

mod.all.con.3.ordered.highinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) + I(abs(cong_consc - self_consc)) + I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + I(abs(cong_emoti - self_emoti))) +
                                I(abs(respondent_AM - cong_AM)) +
                                (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                                data = subset(cces.uber, scaled_info >= median(cces.uber$scaled_info, 
                                                                              na.rm = TRUE)))


mod.rep.con.3.ordered <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) + I(abs(cong_consc - self_consc)) + I(abs(cong_extra - self_extra)) +
                                           I(abs(cong_agree - self_agree)) + I(abs(cong_emoti - self_emoti))) +
                                           I(abs(respondent_AM - cong_AM)) +
                                           (1|state) + (1|statedistrict),
                               data = cces.rep)

mod.rep.con.3.ordered.copartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) + I(abs(cong_consc - self_consc)) + I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + I(abs(cong_emoti - self_emoti))) +
                                I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.rep, copartisan == 1))

mod.rep.con.3.ordered.nopartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) + I(abs(cong_consc - self_consc)) + I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + I(abs(cong_emoti - self_emoti))) +
                                I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.rep, copartisan == 0))

mod.rep.con.3.ordered.lowinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) + I(abs(cong_consc - self_consc)) + I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + I(abs(cong_emoti - self_emoti))) +
                                I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.rep, scaled_info < median(cces.rep$scaled_info, 
                                                                             na.rm = TRUE)))

mod.rep.con.3.ordered.highinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) + I(abs(cong_consc - self_consc)) + I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + I(abs(cong_emoti - self_emoti))) +
                                I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.rep, scaled_info >= median(cces.rep$scaled_info, 
                                                                             na.rm = TRUE)))


mod.sen.con.3.ordered <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) + I(abs(cong_consc - self_consc)) + I(abs(cong_extra - self_extra)) +
                                           I(abs(cong_agree - self_agree)) + I(abs(cong_emoti - self_emoti))) +
                                           I(abs(respondent_AM - cong_AM)) +
                                           (1|state) + (1|statedistrict),
                               data = cces.sen)

mod.sen.con.3.ordered.copartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) + I(abs(cong_consc - self_consc)) + I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + I(abs(cong_emoti - self_emoti))) +
                                I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.sen, copartisan == 1))

mod.sen.con.3.ordered.nopartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) + I(abs(cong_consc - self_consc)) + I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + I(abs(cong_emoti - self_emoti))) +
                                I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.sen, copartisan == 0))

mod.sen.con.3.ordered.lowinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) + I(abs(cong_consc - self_consc)) + I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + I(abs(cong_emoti - self_emoti))) +
                                I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.sen, scaled_info < median(cces.sen$scaled_info, 
                                                                             na.rm = TRUE)))

mod.sen.con.3.ordered.highinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) + I(abs(cong_consc - self_consc)) + I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + I(abs(cong_emoti - self_emoti))) +
                                I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.sen, scaled_info >= median(cces.sen$scaled_info, 
                                                                             na.rm = TRUE)))


mod.all.big.3.ordered <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + cong_consc + cong_extra + cong_agree + cong_emoti +
                                           I(abs(cong_openn - self_openn)) + I(abs(cong_consc - self_consc)) + I(abs(cong_extra - self_extra)) +
                                           I(abs(cong_agree - self_agree)) + I(abs(cong_emoti - self_emoti))) +
                                           I(abs(respondent_AM - cong_AM)) +
                                           (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                               data = cces.uber)

mod.all.big.3.ordered.copartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + cong_consc + cong_extra + cong_agree + cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + I(abs(cong_consc - self_consc)) + I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + I(abs(cong_emoti - self_emoti))) +
                                I(abs(respondent_AM - cong_AM)) +
                                (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                                data = subset(cces.uber, copartisan == 1))

mod.all.big.3.ordered.nopartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + cong_consc + cong_extra + cong_agree + cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + I(abs(cong_consc - self_consc)) + I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + I(abs(cong_emoti - self_emoti))) +
                                I(abs(respondent_AM - cong_AM)) +
                                (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                                data = subset(cces.uber, copartisan == 0))

mod.all.big.3.ordered.lowinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + cong_consc + cong_extra + cong_agree + cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + I(abs(cong_consc - self_consc)) + I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + I(abs(cong_emoti - self_emoti))) +
                                I(abs(respondent_AM - cong_AM)) +
                                (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                                data = subset(cces.uber, scaled_info < median(cces.uber$scaled_info, 
                                                                              na.rm = TRUE)))

mod.all.big.3.ordered.highinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + cong_consc + cong_extra + cong_agree + cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + I(abs(cong_consc - self_consc)) + I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + I(abs(cong_emoti - self_emoti))) +
                                I(abs(respondent_AM - cong_AM)) +
                                (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                                data = subset(cces.uber, scaled_info >= median(cces.uber$scaled_info, 
                                                                              na.rm = TRUE)))


mod.rep.big.3.ordered <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + cong_consc + cong_extra + cong_agree + cong_emoti +
                                           I(abs(cong_openn - self_openn)) + I(abs(cong_consc - self_consc)) + I(abs(cong_extra - self_extra)) +
                                           I(abs(cong_agree - self_agree)) + I(abs(cong_emoti - self_emoti))) +
                                           I(abs(respondent_AM - cong_AM)) +
                                           (1|state) + (1|statedistrict),
                               data = cces.rep)

mod.rep.big.3.ordered.copartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + cong_consc + cong_extra + cong_agree + cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + I(abs(cong_consc - self_consc)) + I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + I(abs(cong_emoti - self_emoti))) +
                                I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.rep, copartisan == 1))

mod.rep.big.3.ordered.nopartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + cong_consc + cong_extra + cong_agree + cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + I(abs(cong_consc - self_consc)) + I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + I(abs(cong_emoti - self_emoti))) +
                                I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.rep, copartisan == 0))

mod.rep.big.3.ordered.lowinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + cong_consc + cong_extra + cong_agree + cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + I(abs(cong_consc - self_consc)) + I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + I(abs(cong_emoti - self_emoti))) +
                                I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.rep, scaled_info < median(cces.rep$scaled_info, 
                                                                             na.rm = TRUE)))

mod.rep.big.3.ordered.highinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + cong_consc + cong_extra + cong_agree + cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + I(abs(cong_consc - self_consc)) + I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + I(abs(cong_emoti - self_emoti))) +
                                I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.rep, scaled_info >= median(cces.rep$scaled_info, 
                                                                             na.rm = TRUE)))


mod.sen.big.3.ordered <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + cong_consc + cong_extra + cong_agree + cong_emoti +
                                           I(abs(cong_openn - self_openn)) + I(abs(cong_consc - self_consc)) + I(abs(cong_extra - self_extra)) +
                                           I(abs(cong_agree - self_agree)) + I(abs(cong_emoti - self_emoti))) +
                                           I(abs(respondent_AM - cong_AM)) +
                                           (1|state) + (1|statedistrict),
                               data = cces.sen)

mod.sen.big.3.ordered.copartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + cong_consc + cong_extra + cong_agree + cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + I(abs(cong_consc - self_consc)) + I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + I(abs(cong_emoti - self_emoti))) +
                                I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.sen, copartisan == 1))

mod.sen.big.3.ordered.nopartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + cong_consc + cong_extra + cong_agree + cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + I(abs(cong_consc - self_consc)) + I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + I(abs(cong_emoti - self_emoti))) +
                                I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.sen, copartisan == 0))

mod.sen.big.3.ordered.lowinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + cong_consc + cong_extra + cong_agree + cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + I(abs(cong_consc - self_consc)) + I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + I(abs(cong_emoti - self_emoti))) +
                                I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.sen, scaled_info < median(cces.sen$scaled_info, 
                                                                             na.rm = TRUE)))

mod.sen.big.3.ordered.highinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + cong_consc + cong_extra + cong_agree + cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + I(abs(cong_consc - self_consc)) + I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + I(abs(cong_emoti - self_emoti))) +
                                I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.sen, scaled_info >= median(cces.sen$scaled_info, 
                                                                             na.rm = TRUE)))


mod.all.val.4.ordered <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + cong_consc + 
                                                                         cong_extra + cong_agree + 
                                                                         cong_emoti) +
                                           scaled_info + I(abs(respondent_AM - cong_AM)) +
                                           (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                               data = cces.uber)

mod.all.val.4.ordered.copartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + cong_consc + 
                                                                                            cong_extra + cong_agree + 
                                                                                            cong_emoti) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                                data = subset(cces.uber, copartisan == 1))

mod.all.val.4.ordered.nopartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + cong_consc + 
                                                                                            cong_extra + cong_agree + 
                                                                                            cong_emoti) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                                data = subset(cces.uber, copartisan == 0))

mod.all.val.4.ordered.lowinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + cong_consc + 
                                                                                            cong_extra + cong_agree + 
                                                                                            cong_emoti) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                                data = subset(cces.uber, scaled_info < median(cces.uber$scaled_info, 
                                                                              na.rm = TRUE)))

mod.all.val.4.ordered.highinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + cong_consc + 
                                                                                            cong_extra + cong_agree + 
                                                                                            cong_emoti) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                                data = subset(cces.uber, scaled_info >= median(cces.uber$scaled_info, 
                                                                              na.rm = TRUE)))


mod.rep.val.4.ordered <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + cong_consc + 
                                                                         cong_extra + cong_agree + 
                                                                         cong_emoti) +
                                           scaled_info + I(abs(respondent_AM - cong_AM)) +
                                           (1|state) + (1|statedistrict),
                               data = cces.rep)

mod.rep.val.4.ordered.copartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + cong_consc + 
                                                                                            cong_extra + cong_agree + 
                                                                                            cong_emoti) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.rep, copartisan == 1))

mod.rep.val.4.ordered.nopartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + cong_consc + 
                                                                                            cong_extra + cong_agree + 
                                                                                            cong_emoti) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.rep, copartisan == 0))

mod.rep.val.4.ordered.lowinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + cong_consc + 
                                                                                            cong_extra + cong_agree + 
                                                                                            cong_emoti) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.rep, scaled_info < median(cces.rep$scaled_info, 
                                                                             na.rm = TRUE)))

mod.rep.val.4.ordered.highinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + cong_consc + 
                                                                                            cong_extra + cong_agree + 
                                                                                            cong_emoti) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.rep, scaled_info >= median(cces.rep$scaled_info, 
                                                                             na.rm = TRUE)))


mod.sen.val.4.ordered <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + cong_consc + 
                                                                         cong_extra + cong_agree + 
                                                                         cong_emoti) +
                                           scaled_info + I(abs(respondent_AM - cong_AM)) +
                                           (1|state) + (1|statedistrict),
                               data = cces.sen)

mod.sen.val.4.ordered.copartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + cong_consc + 
                                                                                            cong_extra + cong_agree + 
                                                                                            cong_emoti) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.sen, copartisan == 1))

mod.sen.val.4.ordered.nopartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + cong_consc + 
                                                                                            cong_extra + cong_agree + 
                                                                                            cong_emoti) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.sen, copartisan == 0))

mod.sen.val.4.ordered.lowinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + cong_consc + 
                                                                                            cong_extra + cong_agree + 
                                                                                            cong_emoti) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.sen, scaled_info < median(cces.sen$scaled_info, 
                                                                             na.rm = TRUE)))

mod.sen.val.4.ordered.highinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + cong_consc + 
                                                                                            cong_extra + cong_agree + 
                                                                                            cong_emoti) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.sen, scaled_info >= median(cces.sen$scaled_info, 
                                                                             na.rm = TRUE)))


mod.all.con.4.ordered <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) + 
                                                                             I(abs(cong_consc - self_consc)) + 
                                                                             I(abs(cong_extra - self_extra)) +
                                                                             I(abs(cong_agree - self_agree)) + 
                                                                             I(abs(cong_emoti - self_emoti))) +
                                           scaled_info + I(abs(respondent_AM - cong_AM)) +
                                           (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                               data = cces.uber)

mod.all.con.4.ordered.copartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + 
                                                                                            I(abs(cong_emoti - self_emoti))) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                                data = subset(cces.uber, copartisan == 1))

mod.all.con.4.ordered.nopartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + 
                                                                                            I(abs(cong_emoti - self_emoti))) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                                data = subset(cces.uber, copartisan == 0))

mod.all.con.4.ordered.lowinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + 
                                                                                            I(abs(cong_emoti - self_emoti))) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                                data = subset(cces.uber, scaled_info < median(cces.uber$scaled_info, 
                                                                              na.rm = TRUE)))

mod.all.con.4.ordered.highinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + 
                                                                                            I(abs(cong_emoti - self_emoti))) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                                data = subset(cces.uber, scaled_info >= median(cces.uber$scaled_info, 
                                                                              na.rm = TRUE)))


mod.rep.con.4.ordered <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) + 
                                                                             I(abs(cong_consc - self_consc)) + 
                                                                             I(abs(cong_extra - self_extra)) +
                                                                             I(abs(cong_agree - self_agree)) + 
                                                                             I(abs(cong_emoti - self_emoti))) +
                                           scaled_info + I(abs(respondent_AM - cong_AM)) +
                                           (1|state) + (1|statedistrict),
                               data = cces.rep)

mod.rep.con.4.ordered.copartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + 
                                                                                            I(abs(cong_emoti - self_emoti))) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.rep, copartisan == 1))

mod.rep.con.4.ordered.nopartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + 
                                                                                            I(abs(cong_emoti - self_emoti))) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.rep, copartisan == 0))

mod.rep.con.4.ordered.lowinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + 
                                                                                            I(abs(cong_emoti - self_emoti))) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.rep, scaled_info < median(cces.rep$scaled_info, 
                                                                             na.rm = TRUE)))

mod.rep.con.4.ordered.highinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + 
                                                                                            I(abs(cong_emoti - self_emoti))) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.rep, scaled_info >= median(cces.rep$scaled_info, 
                                                                             na.rm = TRUE)))


mod.sen.con.4.ordered <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) + 
                                                                             I(abs(cong_consc - self_consc)) + 
                                                                             I(abs(cong_extra - self_extra)) +
                                                                             I(abs(cong_agree - self_agree)) + 
                                                                             I(abs(cong_emoti - self_emoti))) +
                                           scaled_info + I(abs(respondent_AM - cong_AM)) +
                                           (1|state) + (1|statedistrict),
                               data = cces.sen)

mod.sen.con.4.ordered.copartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + 
                                                                                            I(abs(cong_emoti - self_emoti))) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.sen, copartisan == 1))

mod.sen.con.4.ordered.nopartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + 
                                                                                            I(abs(cong_emoti - self_emoti))) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.sen, copartisan == 0))

mod.sen.con.4.ordered.lowinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + 
                                                                                            I(abs(cong_emoti - self_emoti))) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.sen, scaled_info < median(cces.sen$scaled_info, 
                                                                             na.rm = TRUE)))

mod.sen.con.4.ordered.highinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + 
                                                                                            I(abs(cong_emoti - self_emoti))) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.sen, scaled_info >= median(cces.sen$scaled_info, 
                                                                             na.rm = TRUE)))


mod.all.big.4.ordered <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                             cong_consc + 
                                                                             cong_extra + 
                                                                             cong_agree + 
                                                                             cong_emoti +
                                                                             I(abs(cong_openn - self_openn)) + 
                                                                             I(abs(cong_consc - self_consc)) + 
                                                                             I(abs(cong_extra - self_extra)) +
                                                                             I(abs(cong_agree - self_agree)) + 
                                                                             I(abs(cong_emoti - self_emoti))) +
                                           scaled_info + I(abs(respondent_AM - cong_AM)) +
                                           (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                               data = cces.uber)

mod.all.big.4.ordered.copartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                            cong_consc + 
                                                                                            cong_extra + 
                                                                                            cong_agree + 
                                                                                            cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + 
                                                                                            I(abs(cong_emoti - self_emoti))) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                                data = subset(cces.uber, copartisan == 1))


mod.all.big.4.ordered.nopartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                            cong_consc + 
                                                                                            cong_extra + 
                                                                                            cong_agree + 
                                                                                            cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + 
                                                                                            I(abs(cong_emoti - self_emoti))) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                                data = subset(cces.uber, copartisan == 0))


mod.all.big.4.ordered.lowinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                            cong_consc + 
                                                                                            cong_extra + 
                                                                                            cong_agree + 
                                                                                            cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + 
                                                                                            I(abs(cong_emoti - self_emoti))) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                                data = subset(cces.uber, scaled_info < median(cces.uber$scaled_info, 
                                                                              na.rm = TRUE)))


mod.all.big.4.ordered.highinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                            cong_consc + 
                                                                                            cong_extra + 
                                                                                            cong_agree + 
                                                                                            cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + 
                                                                                            I(abs(cong_emoti - self_emoti))) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                                data = subset(cces.uber, scaled_info >= median(cces.uber$scaled_info, 
                                                                              na.rm = TRUE)))


mod.rep.big.4.ordered <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                             cong_consc + 
                                                                             cong_extra + 
                                                                             cong_agree + 
                                                                             cong_emoti +
                                                                             I(abs(cong_openn - self_openn)) + 
                                                                             I(abs(cong_consc - self_consc)) + 
                                                                             I(abs(cong_extra - self_extra)) +
                                                                             I(abs(cong_agree - self_agree)) + 
                                                                             I(abs(cong_emoti - self_emoti))) +
                                           scaled_info + I(abs(respondent_AM - cong_AM)) +
                                           (1|state) + (1|statedistrict),
                               data = cces.rep)

mod.rep.big.4.ordered.copartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                            cong_consc + 
                                                                                            cong_extra + 
                                                                                            cong_agree + 
                                                                                            cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + 
                                                                                            I(abs(cong_emoti - self_emoti))) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.rep, copartisan == 1))


mod.rep.big.4.ordered.nopartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                            cong_consc + 
                                                                                            cong_extra + 
                                                                                            cong_agree + 
                                                                                            cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + 
                                                                                            I(abs(cong_emoti - self_emoti))) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.rep, copartisan == 0))


mod.rep.big.4.ordered.lowinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                            cong_consc + 
                                                                                            cong_extra + 
                                                                                            cong_agree + 
                                                                                            cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + 
                                                                                            I(abs(cong_emoti - self_emoti))) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.rep, scaled_info < median(cces.rep$scaled_info, 
                                                                             na.rm = TRUE)))


mod.rep.big.4.ordered.highinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                            cong_consc + 
                                                                                            cong_extra + 
                                                                                            cong_agree + 
                                                                                            cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + 
                                                                                            I(abs(cong_emoti - self_emoti))) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.rep, scaled_info >= median(cces.rep$scaled_info, 
                                                                             na.rm = TRUE)))


mod.sen.big.4.ordered <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                             cong_consc + 
                                                                             cong_extra + 
                                                                             cong_agree + 
                                                                             cong_emoti +
                                                                             I(abs(cong_openn - self_openn)) + 
                                                                             I(abs(cong_consc - self_consc)) + 
                                                                             I(abs(cong_extra - self_extra)) +
                                                                             I(abs(cong_agree - self_agree)) + 
                                                                             I(abs(cong_emoti - self_emoti))) +
                                           scaled_info + I(abs(respondent_AM - cong_AM)) +
                                           (1|state) + (1|statedistrict),
                               data = cces.sen)

mod.sen.big.4.ordered.copartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                            cong_consc + 
                                                                                            cong_extra + 
                                                                                            cong_agree + 
                                                                                            cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + 
                                                                                            I(abs(cong_emoti - self_emoti))) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.sen, copartisan == 1))


mod.sen.big.4.ordered.nopartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                            cong_consc + 
                                                                                            cong_extra + 
                                                                                            cong_agree + 
                                                                                            cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + 
                                                                                            I(abs(cong_emoti - self_emoti))) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.sen, copartisan == 0))


mod.sen.big.4.ordered.lowinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                            cong_consc + 
                                                                                            cong_extra + 
                                                                                            cong_agree + 
                                                                                            cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + 
                                                                                            I(abs(cong_emoti - self_emoti))) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.sen, scaled_info < median(cces.sen$scaled_info, 
                                                                             na.rm = TRUE)))


mod.sen.big.4.ordered.highinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                            cong_consc + 
                                                                                            cong_extra + 
                                                                                            cong_agree + 
                                                                                            cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + 
                                                                                            I(abs(cong_emoti - self_emoti))) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.sen, scaled_info >= median(cces.sen$scaled_info, 
                                                                             na.rm = TRUE)))


mod.all.big.5.ordered <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                             cong_consc + 
                                                                             cong_extra + 
                                                                             cong_agree + 
                                                                             cong_emoti +
                                                                             I(abs(cong_openn - self_openn)) + 
                                                                             I(abs(cong_consc - self_consc)) + 
                                                                             I(abs(cong_extra - self_extra)) +
                                                                             I(abs(cong_agree - self_agree)) + 
                                                                             I(abs(cong_emoti - self_emoti))) + 
                                           scaled_info + I(abs(respondent_AM - cong_AM)) +
                                           I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                           I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                           as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                           I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                           (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                               data = cces.uber)

mod.all.big.5.ordered.copartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                            cong_consc + 
                                                                                            cong_extra + 
                                                                                            cong_agree + 
                                                                                            cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + 
                                                                                            I(abs(cong_emoti - self_emoti))) + 
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                                data = subset(cces.uber, copartisan == 1))


mod.all.big.5.ordered.nopartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                            cong_consc + 
                                                                                            cong_extra + 
                                                                                            cong_agree + 
                                                                                            cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + 
                                                                                            I(abs(cong_emoti - self_emoti))) + 
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                                data = subset(cces.uber, copartisan == 0))


mod.all.big.5.ordered.lowinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                            cong_consc + 
                                                                                            cong_extra + 
                                                                                            cong_agree + 
                                                                                            cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + 
                                                                                            I(abs(cong_emoti - self_emoti))) + 
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                                data = subset(cces.uber, scaled_info < median(cces.uber$scaled_info, 
                                                                              na.rm = TRUE)))


mod.all.big.5.ordered.highinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                            cong_consc + 
                                                                                            cong_extra + 
                                                                                            cong_agree + 
                                                                                            cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + 
                                                                                            I(abs(cong_emoti - self_emoti))) + 
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                                data = subset(cces.uber, scaled_info >= median(cces.uber$scaled_info, 
                                                                              na.rm = TRUE)))


mod.rep.big.5.ordered <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                             cong_consc + 
                                                                             cong_extra + 
                                                                             cong_agree + 
                                                                             cong_emoti +
                                                                             I(abs(cong_openn - self_openn)) + 
                                                                             I(abs(cong_consc - self_consc)) + 
                                                                             I(abs(cong_extra - self_extra)) +
                                                                             I(abs(cong_agree - self_agree)) +
                                                                             I(abs(cong_emoti - self_emoti))) + 
                                           scaled_info + I(abs(respondent_AM - cong_AM)) +
                                           I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                           I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                           as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                           I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                           (1|state) + (1|statedistrict),
                               data = cces.rep)

mod.rep.big.5.ordered.copartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                            cong_consc + 
                                                                                            cong_extra + 
                                                                                            cong_agree + 
                                                                                            cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) +
                                                                                            I(abs(cong_emoti - self_emoti))) + 
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.rep, copartisan == 1))


mod.rep.big.5.ordered.nopartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                            cong_consc + 
                                                                                            cong_extra + 
                                                                                            cong_agree + 
                                                                                            cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) +
                                                                                            I(abs(cong_emoti - self_emoti))) + 
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.rep, copartisan == 0))


mod.rep.big.5.ordered.lowinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                            cong_consc + 
                                                                                            cong_extra + 
                                                                                            cong_agree + 
                                                                                            cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) +
                                                                                            I(abs(cong_emoti - self_emoti))) + 
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.rep, scaled_info < median(cces.rep$scaled_info, 
                                                                             na.rm = TRUE)))


mod.rep.big.5.ordered.highinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                            cong_consc + 
                                                                                            cong_extra + 
                                                                                            cong_agree + 
                                                                                            cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) +
                                                                                            I(abs(cong_emoti - self_emoti))) + 
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.rep, scaled_info >= median(cces.rep$scaled_info, 
                                                                             na.rm = TRUE)))


mod.sen.big.5.ordered <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                             cong_consc + 
                                                                             cong_extra + 
                                                                             cong_agree + 
                                                                             cong_emoti +
                                                                             I(abs(cong_openn - self_openn)) + 
                                                                             I(abs(cong_consc - self_consc)) + 
                                                                             I(abs(cong_extra - self_extra)) +
                                                                             I(abs(cong_agree - self_agree)) + 
                                                                             I(abs(cong_emoti - self_emoti))) + 
                                           scaled_info + I(abs(respondent_AM - cong_AM)) +
                                           I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                           I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                           as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                           I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                           (1|state) + (1|statedistrict),
                               data = cces.sen)


mod.sen.big.5.ordered.copartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                            cong_consc + 
                                                                                            cong_extra + 
                                                                                            cong_agree + 
                                                                                            cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + 
                                                                                            I(abs(cong_emoti - self_emoti))) + 
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.sen, copartisan == 1))


mod.sen.big.5.ordered.nopartisan <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                            cong_consc + 
                                                                                            cong_extra + 
                                                                                            cong_agree + 
                                                                                            cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + 
                                                                                            I(abs(cong_emoti - self_emoti))) + 
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.sen, copartisan == 0))


mod.sen.big.5.ordered.lowinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                            cong_consc + 
                                                                                            cong_extra + 
                                                                                            cong_agree + 
                                                                                            cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + 
                                                                                            I(abs(cong_emoti - self_emoti))) + 
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.sen, scaled_info < median(cces.sen$scaled_info, 
                                                                             na.rm = TRUE)))


mod.sen.big.5.ordered.highinfo <- clmm(factor(cong_app) ~ (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                            cong_consc + 
                                                                                            cong_extra + 
                                                                                            cong_agree + 
                                                                                            cong_emoti +
                                                                                            I(abs(cong_openn - self_openn)) + 
                                                                                            I(abs(cong_consc - self_consc)) + 
                                                                                            I(abs(cong_extra - self_extra)) +
                                                                                            I(abs(cong_agree - self_agree)) + 
                                                                                            I(abs(cong_emoti - self_emoti))) + 
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.sen, scaled_info >= median(cces.sen$scaled_info, 
                                                                             na.rm = TRUE)))


mod.all.con.5.ordered <- clmm(factor(cong_app) ~  (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) +
                                                                              I(abs(cong_consc - self_consc)) + 
                                                                              I(abs(cong_extra - self_extra)) +
                                                                              I(abs(cong_agree - self_agree)) + 
                                                                              I(abs(cong_emoti - self_emoti))) + 
                                           scaled_info + I(abs(respondent_AM - cong_AM)) +
                                           I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                           I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                           as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                           I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                           (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                               data = cces.uber)

mod.all.con.5.ordered.copartisan <- clmm(factor(cong_app) ~  (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) +
                                                                                             I(abs(cong_consc - self_consc)) + 
                                                                                             I(abs(cong_extra - self_extra)) +
                                                                                             I(abs(cong_agree - self_agree)) + 
                                                                                             I(abs(cong_emoti - self_emoti))) + 
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                                data = subset(cces.uber, copartisan == 1))


mod.all.con.5.ordered.nopartisan <- clmm(factor(cong_app) ~  (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) +
                                                                                             I(abs(cong_consc - self_consc)) + 
                                                                                             I(abs(cong_extra - self_extra)) +
                                                                                             I(abs(cong_agree - self_agree)) + 
                                                                                             I(abs(cong_emoti - self_emoti))) + 
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                                data = subset(cces.uber, copartisan == 0))


mod.all.con.5.ordered.lowinfo <- clmm(factor(cong_app) ~  (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) +
                                                                                             I(abs(cong_consc - self_consc)) + 
                                                                                             I(abs(cong_extra - self_extra)) +
                                                                                             I(abs(cong_agree - self_agree)) + 
                                                                                             I(abs(cong_emoti - self_emoti))) + 
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                                data = subset(cces.uber, scaled_info < median(cces.uber$scaled_info, 
                                                                              na.rm = TRUE)))


mod.all.con.5.ordered.highinfo <- clmm(factor(cong_app) ~  (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) +
                                                                                             I(abs(cong_consc - self_consc)) + 
                                                                                             I(abs(cong_extra - self_extra)) +
                                                                                             I(abs(cong_agree - self_agree)) + 
                                                                                             I(abs(cong_emoti - self_emoti))) + 
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                                data = subset(cces.uber, scaled_info >= median(cces.uber$scaled_info, 
                                                                              na.rm = TRUE)))


mod.rep.con.5.ordered <- clmm(factor(cong_app) ~  (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) +
                                                                              I(abs(cong_consc - self_consc)) + 
                                                                              I(abs(cong_extra - self_extra)) +
                                                                              I(abs(cong_agree - self_agree)) + 
                                                                              I(abs(cong_emoti - self_emoti))) + 
                                           scaled_info + I(abs(respondent_AM - cong_AM)) +
                                           I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                           I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                           as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                           I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                           (1|state) + (1|statedistrict),
                               data = cces.rep)

mod.rep.con.5.ordered.copartisan <- clmm(factor(cong_app) ~  (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) +
                                                                                             I(abs(cong_consc - self_consc)) + 
                                                                                             I(abs(cong_extra - self_extra)) +
                                                                                             I(abs(cong_agree - self_agree)) + 
                                                                                             I(abs(cong_emoti - self_emoti))) + 
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.rep, copartisan == 1))

mod.rep.con.5.ordered.nopartisan <- clmm(factor(cong_app) ~  (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) +
                                                                                             I(abs(cong_consc - self_consc)) + 
                                                                                             I(abs(cong_extra - self_extra)) +
                                                                                             I(abs(cong_agree - self_agree)) + 
                                                                                             I(abs(cong_emoti - self_emoti))) + 
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.rep, copartisan == 0))

mod.rep.con.5.ordered.lowinfo <- clmm(factor(cong_app) ~  (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) +
                                                                                             I(abs(cong_consc - self_consc)) + 
                                                                                             I(abs(cong_extra - self_extra)) +
                                                                                             I(abs(cong_agree - self_agree)) + 
                                                                                             I(abs(cong_emoti - self_emoti))) + 
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.rep, scaled_info < median(cces.rep$scaled_info, 
                                                                             na.rm = TRUE)))

mod.rep.con.5.ordered.highinfo <- clmm(factor(cong_app) ~  (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) +
                                                                                             I(abs(cong_consc - self_consc)) + 
                                                                                             I(abs(cong_extra - self_extra)) +
                                                                                             I(abs(cong_agree - self_agree)) + 
                                                                                             I(abs(cong_emoti - self_emoti))) + 
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.rep, scaled_info >= median(cces.rep$scaled_info, 
                                                                             na.rm = TRUE)))

mod.sen.con.5.ordered <- clmm(factor(cong_app) ~  (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) +
                                                                              I(abs(cong_consc - self_consc)) + 
                                                                              I(abs(cong_extra - self_extra)) +
                                                                              I(abs(cong_agree - self_agree)) + 
                                                                              I(abs(cong_emoti - self_emoti))) + 
                                           scaled_info + I(abs(respondent_AM - cong_AM)) +
                                           I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                           I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                           as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                           I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                           (1|state) + (1|statedistrict),
                               data = cces.sen)

mod.sen.con.5.ordered.copartisan <- clmm(factor(cong_app) ~  (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) +
                                                                                             I(abs(cong_consc - self_consc)) + 
                                                                                             I(abs(cong_extra - self_extra)) +
                                                                                             I(abs(cong_agree - self_agree)) + 
                                                                                             I(abs(cong_emoti - self_emoti))) + 
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.sen, copartisan == 1))

mod.sen.con.5.ordered.nopartisan <- clmm(factor(cong_app) ~  (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) +
                                                                                             I(abs(cong_consc - self_consc)) + 
                                                                                             I(abs(cong_extra - self_extra)) +
                                                                                             I(abs(cong_agree - self_agree)) + 
                                                                                             I(abs(cong_emoti - self_emoti))) + 
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.sen, copartisan == 0))

mod.sen.con.5.ordered.lowinfo <- clmm(factor(cong_app) ~  (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) +
                                                                                             I(abs(cong_consc - self_consc)) + 
                                                                                             I(abs(cong_extra - self_extra)) +
                                                                                             I(abs(cong_agree - self_agree)) + 
                                                                                             I(abs(cong_emoti - self_emoti))) + 
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.sen, scaled_info < median(cces.sen$scaled_info, 
                                                                             na.rm = TRUE)))

mod.sen.con.5.ordered.highinfo <- clmm(factor(cong_app) ~  (respondent_AM + I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) +
                                                                                             I(abs(cong_consc - self_consc)) + 
                                                                                             I(abs(cong_extra - self_extra)) +
                                                                                             I(abs(cong_agree - self_agree)) + 
                                                                                             I(abs(cong_emoti - self_emoti))) + 
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.sen, scaled_info >= median(cces.sen$scaled_info, 
                                                                             na.rm = TRUE)))

mod.all.val.5.ordered <- clmm(factor(cong_app) ~  (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                              cong_consc + 
                                                                              cong_extra + 
                                                                              cong_agree + 
                                                                              cong_emoti) +
                                           scaled_info + I(abs(respondent_AM - cong_AM)) +
                                           I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                           I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                           as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                           I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                           (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                               data = cces.uber)

mod.all.val.5.ordered.copartisan <- clmm(factor(cong_app) ~  (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                             cong_consc + 
                                                                                             cong_extra + 
                                                                                             cong_agree + 
                                                                                             cong_emoti) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                                data = subset(cces.uber, copartisan == 1))

mod.all.val.5.ordered.nopartisan <- clmm(factor(cong_app) ~  (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                             cong_consc + 
                                                                                             cong_extra + 
                                                                                             cong_agree + 
                                                                                             cong_emoti) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                                data = subset(cces.uber, copartisan == 0))

mod.all.val.5.ordered.lowinfo <- clmm(factor(cong_app) ~  (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                             cong_consc + 
                                                                                             cong_extra + 
                                                                                             cong_agree + 
                                                                                             cong_emoti) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                                data = subset(cces.uber, scaled_info < median(cces.uber$scaled_info, 
                                                                              na.rm = TRUE)))

mod.all.val.5.ordered.highinfo <- clmm(factor(cong_app) ~  (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                             cong_consc + 
                                                                                             cong_extra + 
                                                                                             cong_agree + 
                                                                                             cong_emoti) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|office3) + (1|state) + (1|statedistrict) + (1|V101),
                                data = subset(cces.uber, scaled_info >= median(cces.uber$scaled_info, 
                                                                              na.rm = TRUE)))


mod.rep.val.5.ordered <- clmm(factor(cong_app) ~  (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                              cong_consc + 
                                                                              cong_extra + 
                                                                              cong_agree + 
                                                                              cong_emoti) +
                                           scaled_info + I(abs(respondent_AM - cong_AM)) +
                                           I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                           I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                           as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                           I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                           (1|state) + (1|statedistrict),
                               data = cces.rep)

mod.rep.val.5.ordered.copartisan <- clmm(factor(cong_app) ~  (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                             cong_consc + 
                                                                                             cong_extra + 
                                                                                             cong_agree + 
                                                                                             cong_emoti) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.rep, copartisan == 1))

mod.rep.val.5.ordered.nopartisan <- clmm(factor(cong_app) ~  (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                             cong_consc + 
                                                                                             cong_extra + 
                                                                                             cong_agree + 
                                                                                             cong_emoti) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.rep, copartisan == 0))

mod.rep.val.5.ordered.lowinfo <- clmm(factor(cong_app) ~  (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                             cong_consc + 
                                                                                             cong_extra + 
                                                                                             cong_agree + 
                                                                                             cong_emoti) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.rep, scaled_info < median(cces.rep$scaled_info, 
                                                                             na.rm = TRUE)))

mod.rep.val.5.ordered.highinfo <- clmm(factor(cong_app) ~  (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                             cong_consc + 
                                                                                             cong_extra + 
                                                                                             cong_agree + 
                                                                                             cong_emoti) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.rep, scaled_info >= median(cces.rep$scaled_info, 
                                                                             na.rm = TRUE)))


mod.sen.val.5.ordered <- clmm(factor(cong_app) ~  (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                              cong_consc + 
                                                                              cong_extra + 
                                                                              cong_agree + 
                                                                              cong_emoti) +
                                           scaled_info + I(abs(respondent_AM - cong_AM)) +
                                           I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                           I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                           as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                           I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                           (1|state) + (1|statedistrict),
                               data = cces.sen)

mod.sen.val.5.ordered.copartisan <- clmm(factor(cong_app) ~  (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                             cong_consc + 
                                                                                             cong_extra + 
                                                                                             cong_agree + 
                                                                                             cong_emoti) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.sen, copartisan == 1))

mod.sen.val.5.ordered.nopartisan <- clmm(factor(cong_app) ~  (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                             cong_consc + 
                                                                                             cong_extra + 
                                                                                             cong_agree + 
                                                                                             cong_emoti) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.sen, copartisan == 0))

mod.sen.val.5.ordered.lowinfo <- clmm(factor(cong_app) ~  (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                             cong_consc + 
                                                                                             cong_extra + 
                                                                                             cong_agree + 
                                                                                             cong_emoti) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.sen, scaled_info < median(cces.sen$scaled_info, 
                                                                             na.rm = TRUE)))

mod.sen.val.5.ordered.highinfo <- clmm(factor(cong_app) ~  (respondent_AM + I(abs(respondent_AM)))*(cong_openn + 
                                                                                             cong_consc + 
                                                                                             cong_extra + 
                                                                                             cong_agree + 
                                                                                             cong_emoti) +
                                scaled_info + I(abs(respondent_AM - cong_AM)) +
                                I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                (1|state) + (1|statedistrict),
                                data = subset(cces.sen, scaled_info >= median(cces.sen$scaled_info, 
                                                                             na.rm = TRUE)))


set.seed(1)
relative.con.mod.1 <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                                  I(abs(self_openn - sen1_openn) - abs(self_openn - sen2_openn)) +
                                  I(abs(self_consc - sen1_consc) - abs(self_consc - sen2_consc)) +
                                  I(abs(self_extra - sen1_extra) - abs(self_extra - sen2_extra)) +
                                  I(abs(self_agree - sen1_agree) - abs(self_agree - sen2_agree)) +
                                  I(abs(self_emoti - sen1_emoti) - abs(self_emoti - sen2_emoti)) +
                                  (1|state) + (1|statedistrict),
                                  data = cces.both)

relative.con.mod.1.lowinfo <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                             I(abs(self_openn - sen1_openn) - abs(self_openn - sen2_openn)) +
                             I(abs(self_consc - sen1_consc) - abs(self_consc - sen2_consc)) +
                             I(abs(self_extra - sen1_extra) - abs(self_extra - sen2_extra)) +
                             I(abs(self_agree - sen1_agree) - abs(self_agree - sen2_agree)) +
                             I(abs(self_emoti - sen1_emoti) - abs(self_emoti - sen2_emoti)) +
                             (1|state) + (1|statedistrict),
                             data = subset(cces.both, scaled_info < median(cces.both$scaled_info, 
                                                                           na.rm = TRUE)))

relative.con.mod.1.highinfo <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                             I(abs(self_openn - sen1_openn) - abs(self_openn - sen2_openn)) +
                             I(abs(self_consc - sen1_consc) - abs(self_consc - sen2_consc)) +
                             I(abs(self_extra - sen1_extra) - abs(self_extra - sen2_extra)) +
                             I(abs(self_agree - sen1_agree) - abs(self_agree - sen2_agree)) +
                             I(abs(self_emoti - sen1_emoti) - abs(self_emoti - sen2_emoti)) +
                             (1|state) + (1|statedistrict),
                             data = subset(cces.both, scaled_info >= median(cces.both$scaled_info, 
                                                                           na.rm = TRUE)))


relative.val.mod.1 <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                                  I(sen2_openn - sen1_openn) +
                                  I(sen2_consc - sen1_consc) +
                                  I(sen2_extra - sen1_extra) +
                                  I(sen2_agree - sen1_agree) +
                                  I(sen2_emoti - sen1_emoti) +
                                  (1|state) + (1|statedistrict),
                                  data = cces.both)

relative.val.mod.1.lowinfo <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                             I(sen2_openn - sen1_openn) +
                             I(sen2_consc - sen1_consc) +
                             I(sen2_extra - sen1_extra) +
                             I(sen2_agree - sen1_agree) +
                             I(sen2_emoti - sen1_emoti) +
                             (1|state) + (1|statedistrict),
                             data = subset(cces.both, scaled_info < median(cces.both$scaled_info, 
                                                                           na.rm = TRUE)))

relative.val.mod.1.highinfo <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                             I(sen2_openn - sen1_openn) +
                             I(sen2_consc - sen1_consc) +
                             I(sen2_extra - sen1_extra) +
                             I(sen2_agree - sen1_agree) +
                             I(sen2_emoti - sen1_emoti) +
                             (1|state) + (1|statedistrict),
                             data = subset(cces.both, scaled_info >= median(cces.both$scaled_info, 
                                                                           na.rm = TRUE)))


relative.big.mod.1 <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                                  I(sen2_openn - sen1_openn) +
                                  I(sen2_consc - sen1_consc) +
                                  I(sen2_extra - sen1_extra) +
                                  I(sen2_agree - sen1_agree) +
                                  I(sen2_emoti - sen1_emoti) +
                                  I(abs(self_openn - sen1_openn) - abs(self_openn - sen2_openn)) +
                                  I(abs(self_consc - sen1_consc) - abs(self_consc - sen2_consc)) +
                                  I(abs(self_extra - sen1_extra) - abs(self_extra - sen2_extra)) +
                                  I(abs(self_agree - sen1_agree) - abs(self_agree - sen2_agree)) +
                                  I(abs(self_emoti - sen1_emoti) - abs(self_emoti - sen2_emoti)) +
                                  (1|state) + (1|statedistrict),
                                  data = cces.both)

relative.big.mod.1.lowinfo <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                             I(sen2_openn - sen1_openn) +
                             I(sen2_consc - sen1_consc) +
                             I(sen2_extra - sen1_extra) +
                             I(sen2_agree - sen1_agree) +
                             I(sen2_emoti - sen1_emoti) +
                             I(abs(self_openn - sen1_openn) - abs(self_openn - sen2_openn)) +
                             I(abs(self_consc - sen1_consc) - abs(self_consc - sen2_consc)) +
                             I(abs(self_extra - sen1_extra) - abs(self_extra - sen2_extra)) +
                             I(abs(self_agree - sen1_agree) - abs(self_agree - sen2_agree)) +
                             I(abs(self_emoti - sen1_emoti) - abs(self_emoti - sen2_emoti)) +
                             (1|state) + (1|statedistrict),
                             data = subset(cces.both, scaled_info < median(cces.both$scaled_info, 
                                                                           na.rm = TRUE)))

relative.big.mod.1.highinfo <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                             I(sen2_openn - sen1_openn) +
                             I(sen2_consc - sen1_consc) +
                             I(sen2_extra - sen1_extra) +
                             I(sen2_agree - sen1_agree) +
                             I(sen2_emoti - sen1_emoti) +
                             I(abs(self_openn - sen1_openn) - abs(self_openn - sen2_openn)) +
                             I(abs(self_consc - sen1_consc) - abs(self_consc - sen2_consc)) +
                             I(abs(self_extra - sen1_extra) - abs(self_extra - sen2_extra)) +
                             I(abs(self_agree - sen1_agree) - abs(self_agree - sen2_agree)) +
                             I(abs(self_emoti - sen1_emoti) - abs(self_emoti - sen2_emoti)) +
                             (1|state) + (1|statedistrict),
                             data = subset(cces.both, scaled_info >= median(cces.both$scaled_info, 
                                                                           na.rm = TRUE)))


relative.con.mod.2 <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                                  I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                                  I(abs(self_openn - sen1_openn) - abs(self_openn - sen2_openn)) +
                                  I(abs(self_consc - sen1_consc) - abs(self_consc - sen2_consc)) +
                                  I(abs(self_extra - sen1_extra) - abs(self_extra - sen2_extra)) +
                                  I(abs(self_agree - sen1_agree) - abs(self_agree - sen2_agree)) +
                                  I(abs(self_emoti - sen1_emoti) - abs(self_emoti - sen2_emoti)) +
                                  (1|state) + (1|statedistrict),
                                  data = cces.both)

relative.con.mod.2.lowinfo <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                             I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                             I(abs(self_openn - sen1_openn) - abs(self_openn - sen2_openn)) +
                             I(abs(self_consc - sen1_consc) - abs(self_consc - sen2_consc)) +
                             I(abs(self_extra - sen1_extra) - abs(self_extra - sen2_extra)) +
                             I(abs(self_agree - sen1_agree) - abs(self_agree - sen2_agree)) +
                             I(abs(self_emoti - sen1_emoti) - abs(self_emoti - sen2_emoti)) +
                             (1|state) + (1|statedistrict),
                             data = subset(cces.both, scaled_info < median(cces.both$scaled_info, 
                                                                           na.rm = TRUE)))

relative.con.mod.2.highinfo <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                             I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                             I(abs(self_openn - sen1_openn) - abs(self_openn - sen2_openn)) +
                             I(abs(self_consc - sen1_consc) - abs(self_consc - sen2_consc)) +
                             I(abs(self_extra - sen1_extra) - abs(self_extra - sen2_extra)) +
                             I(abs(self_agree - sen1_agree) - abs(self_agree - sen2_agree)) +
                             I(abs(self_emoti - sen1_emoti) - abs(self_emoti - sen2_emoti)) +
                             (1|state) + (1|statedistrict),
                             data = subset(cces.both, scaled_info >= median(cces.both$scaled_info, 
                                                                           na.rm = TRUE)))


relative.val.mod.2 <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                                  I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                                  I(sen2_openn - sen1_openn) +
                                  I(sen2_consc - sen1_consc) +
                                  I(sen2_extra - sen1_extra) +
                                  I(sen2_agree - sen1_agree) +
                                  I(sen2_emoti - sen1_emoti) +
                                  (1|state) + (1|statedistrict),
                                  data = cces.both)

relative.val.mod.2.lowinfo <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                             I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                             I(sen2_openn - sen1_openn) +
                             I(sen2_consc - sen1_consc) +
                             I(sen2_extra - sen1_extra) +
                             I(sen2_agree - sen1_agree) +
                             I(sen2_emoti - sen1_emoti) +
                             (1|state) + (1|statedistrict),
                             data = subset(cces.both, scaled_info < median(cces.both$scaled_info, 
                                                                           na.rm = TRUE)))

relative.val.mod.2.highinfo <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                             I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                             I(sen2_openn - sen1_openn) +
                             I(sen2_consc - sen1_consc) +
                             I(sen2_extra - sen1_extra) +
                             I(sen2_agree - sen1_agree) +
                             I(sen2_emoti - sen1_emoti) +
                             (1|state) + (1|statedistrict),
                             data = subset(cces.both, scaled_info >= median(cces.both$scaled_info, 
                                                                           na.rm = TRUE)))


relative.big.mod.2 <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                                  I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                                  I(sen2_openn - sen1_openn) +
                                  I(sen2_consc - sen1_consc) +
                                  I(sen2_extra - sen1_extra) +
                                  I(sen2_agree - sen1_agree) +
                                  I(sen2_emoti - sen1_emoti) +
                                  I(abs(self_openn - sen1_openn) - abs(self_openn - sen2_openn)) +
                                  I(abs(self_consc - sen1_consc) - abs(self_consc - sen2_consc)) +
                                  I(abs(self_extra - sen1_extra) - abs(self_extra - sen2_extra)) +
                                  I(abs(self_agree - sen1_agree) - abs(self_agree - sen2_agree)) +
                                  I(abs(self_emoti - sen1_emoti) - abs(self_emoti - sen2_emoti)) +
                                  (1|state) + (1|statedistrict),
                                  data = cces.both)

relative.big.mod.2.lowinfo <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                             I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                             I(sen2_openn - sen1_openn) +
                             I(sen2_consc - sen1_consc) +
                             I(sen2_extra - sen1_extra) +
                             I(sen2_agree - sen1_agree) +
                             I(sen2_emoti - sen1_emoti) +
                             I(abs(self_openn - sen1_openn) - abs(self_openn - sen2_openn)) +
                             I(abs(self_consc - sen1_consc) - abs(self_consc - sen2_consc)) +
                             I(abs(self_extra - sen1_extra) - abs(self_extra - sen2_extra)) +
                             I(abs(self_agree - sen1_agree) - abs(self_agree - sen2_agree)) +
                             I(abs(self_emoti - sen1_emoti) - abs(self_emoti - sen2_emoti)) +
                             (1|state) + (1|statedistrict),
                             data = subset(cces.both, scaled_info < median(cces.both$scaled_info, 
                                                                           na.rm = TRUE)))

relative.big.mod.2.highinfo <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                             I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                             I(sen2_openn - sen1_openn) +
                             I(sen2_consc - sen1_consc) +
                             I(sen2_extra - sen1_extra) +
                             I(sen2_agree - sen1_agree) +
                             I(sen2_emoti - sen1_emoti) +
                             I(abs(self_openn - sen1_openn) - abs(self_openn - sen2_openn)) +
                             I(abs(self_consc - sen1_consc) - abs(self_consc - sen2_consc)) +
                             I(abs(self_extra - sen1_extra) - abs(self_extra - sen2_extra)) +
                             I(abs(self_agree - sen1_agree) - abs(self_agree - sen2_agree)) +
                             I(abs(self_emoti - sen1_emoti) - abs(self_emoti - sen2_emoti)) +
                             (1|state) + (1|statedistrict),
                             data = subset(cces.both, scaled_info >= median(cces.both$scaled_info, 
                                                                           na.rm = TRUE)))


relative.con.mod.3 <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                                  I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                                  (respondent_AM + I(abs(respondent_AM))) *
                                  (I(abs(self_openn - sen1_openn) - abs(self_openn - sen2_openn)) +
                                  I(abs(self_consc - sen1_consc) - abs(self_consc - sen2_consc)) +
                                  I(abs(self_extra - sen1_extra) - abs(self_extra - sen2_extra)) +
                                  I(abs(self_agree - sen1_agree) - abs(self_agree - sen2_agree)) +
                                  I(abs(self_emoti - sen1_emoti) - abs(self_emoti - sen2_emoti))) +
                                  (1|state) + (1|statedistrict),
                                  data = cces.both)

relative.con.mod.3.lowinfo <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                             I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                             (respondent_AM + I(abs(respondent_AM))) *
                             (I(abs(self_openn - sen1_openn) - abs(self_openn - sen2_openn)) +
                                I(abs(self_consc - sen1_consc) - abs(self_consc - sen2_consc)) +
                                I(abs(self_extra - sen1_extra) - abs(self_extra - sen2_extra)) +
                                I(abs(self_agree - sen1_agree) - abs(self_agree - sen2_agree)) +
                                I(abs(self_emoti - sen1_emoti) - abs(self_emoti - sen2_emoti))) +
                             (1|state) + (1|statedistrict),
                             data = subset(cces.both, scaled_info < median(cces.both$scaled_info, 
                                                                           na.rm = TRUE)))

relative.con.mod.3.highinfo <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                             I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                             (respondent_AM + I(abs(respondent_AM))) *
                             (I(abs(self_openn - sen1_openn) - abs(self_openn - sen2_openn)) +
                                I(abs(self_consc - sen1_consc) - abs(self_consc - sen2_consc)) +
                                I(abs(self_extra - sen1_extra) - abs(self_extra - sen2_extra)) +
                                I(abs(self_agree - sen1_agree) - abs(self_agree - sen2_agree)) +
                                I(abs(self_emoti - sen1_emoti) - abs(self_emoti - sen2_emoti))) +
                             (1|state) + (1|statedistrict),
                             data = subset(cces.both, scaled_info >= median(cces.both$scaled_info, 
                                                                           na.rm = TRUE)))


relative.val.mod.3 <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                                  I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                                  (respondent_AM + I(abs(respondent_AM))) *
                                  (I(sen2_openn - sen1_openn) +
                                  I(sen2_consc - sen1_consc) +
                                  I(sen2_extra - sen1_extra) +
                                  I(sen2_agree - sen1_agree) +
                                  I(sen2_emoti - sen1_emoti)) +
                                  (1|state) + (1|statedistrict),
                                  data = cces.both)

relative.val.mod.3.lowinfo <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                             I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                             (respondent_AM + I(abs(respondent_AM))) *
                             (I(sen2_openn - sen1_openn) +
                                I(sen2_consc - sen1_consc) +
                                I(sen2_extra - sen1_extra) +
                                I(sen2_agree - sen1_agree) +
                                I(sen2_emoti - sen1_emoti)) +
                             (1|state) + (1|statedistrict),
                             data = subset(cces.both, scaled_info < median(cces.both$scaled_info, 
                                                                           na.rm = TRUE)))

relative.val.mod.3.highinfo <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                             I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                             (respondent_AM + I(abs(respondent_AM))) *
                             (I(sen2_openn - sen1_openn) +
                                I(sen2_consc - sen1_consc) +
                                I(sen2_extra - sen1_extra) +
                                I(sen2_agree - sen1_agree) +
                                I(sen2_emoti - sen1_emoti)) +
                             (1|state) + (1|statedistrict),
                             data = subset(cces.both, scaled_info >= median(cces.both$scaled_info, 
                                                                           na.rm = TRUE)))


relative.big.mod.3 <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                                  I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                                  (respondent_AM + I(abs(respondent_AM))) *
                                  (I(sen2_openn - sen1_openn) +
                                  I(sen2_consc - sen1_consc) +
                                  I(sen2_extra - sen1_extra) +
                                  I(sen2_agree - sen1_agree) +
                                  I(sen2_emoti - sen1_emoti) +
                                  I(abs(self_openn - sen1_openn) - abs(self_openn - sen2_openn)) +
                                  I(abs(self_consc - sen1_consc) - abs(self_consc - sen2_consc)) +
                                  I(abs(self_extra - sen1_extra) - abs(self_extra - sen2_extra)) +
                                  I(abs(self_agree - sen1_agree) - abs(self_agree - sen2_agree)) +
                                  I(abs(self_emoti - sen1_emoti) - abs(self_emoti - sen2_emoti))) +
                                  (1|state) + (1|statedistrict),
                                  data = cces.both)

relative.big.mod.3.lowinfo <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                             I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                             (respondent_AM + I(abs(respondent_AM))) *
                             (I(sen2_openn - sen1_openn) +
                                I(sen2_consc - sen1_consc) +
                                I(sen2_extra - sen1_extra) +
                                I(sen2_agree - sen1_agree) +
                                I(sen2_emoti - sen1_emoti) +
                                I(abs(self_openn - sen1_openn) - abs(self_openn - sen2_openn)) +
                                I(abs(self_consc - sen1_consc) - abs(self_consc - sen2_consc)) +
                                I(abs(self_extra - sen1_extra) - abs(self_extra - sen2_extra)) +
                                I(abs(self_agree - sen1_agree) - abs(self_agree - sen2_agree)) +
                                I(abs(self_emoti - sen1_emoti) - abs(self_emoti - sen2_emoti))) +
                             (1|state) + (1|statedistrict),
                             data = subset(cces.both, scaled_info < median(cces.both$scaled_info, 
                                                                           na.rm = TRUE)))


relative.big.mod.3.highinfo <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                             I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                             (respondent_AM + I(abs(respondent_AM))) *
                             (I(sen2_openn - sen1_openn) +
                                I(sen2_consc - sen1_consc) +
                                I(sen2_extra - sen1_extra) +
                                I(sen2_agree - sen1_agree) +
                                I(sen2_emoti - sen1_emoti) +
                                I(abs(self_openn - sen1_openn) - abs(self_openn - sen2_openn)) +
                                I(abs(self_consc - sen1_consc) - abs(self_consc - sen2_consc)) +
                                I(abs(self_extra - sen1_extra) - abs(self_extra - sen2_extra)) +
                                I(abs(self_agree - sen1_agree) - abs(self_agree - sen2_agree)) +
                                I(abs(self_emoti - sen1_emoti) - abs(self_emoti - sen2_emoti))) +
                             (1|state) + (1|statedistrict),
                             data = subset(cces.both, scaled_info >= median(cces.both$scaled_info, 
                                                                           na.rm = TRUE)))


relative.con.mod.4 <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                                  I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                                  (respondent_AM + I(abs(respondent_AM))) *
                                  (I(abs(self_openn - sen1_openn) - abs(self_openn - sen2_openn)) +
                                  I(abs(self_consc - sen1_consc) - abs(self_consc - sen2_consc)) +
                                  I(abs(self_extra - sen1_extra) - abs(self_extra - sen2_extra)) +
                                  I(abs(self_agree - sen1_agree) - abs(self_agree - sen2_agree)) +
                                  I(abs(self_emoti - sen1_emoti) - abs(self_emoti - sen2_emoti))) +
                                  scaled_info + 
                                  (1|state) + (1|statedistrict),
                                  data = cces.both)

relative.con.mod.4.lowinfo <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                             I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                             (respondent_AM + I(abs(respondent_AM))) *
                             (I(abs(self_openn - sen1_openn) - abs(self_openn - sen2_openn)) +
                                I(abs(self_consc - sen1_consc) - abs(self_consc - sen2_consc)) +
                                I(abs(self_extra - sen1_extra) - abs(self_extra - sen2_extra)) +
                                I(abs(self_agree - sen1_agree) - abs(self_agree - sen2_agree)) +
                                I(abs(self_emoti - sen1_emoti) - abs(self_emoti - sen2_emoti))) +
                             scaled_info + 
                             (1|state) + (1|statedistrict),
                             data = subset(cces.both, scaled_info < median(cces.both$scaled_info, 
                                                                           na.rm = TRUE)))

relative.con.mod.4.highinfo <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                             I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                             (respondent_AM + I(abs(respondent_AM))) *
                             (I(abs(self_openn - sen1_openn) - abs(self_openn - sen2_openn)) +
                                I(abs(self_consc - sen1_consc) - abs(self_consc - sen2_consc)) +
                                I(abs(self_extra - sen1_extra) - abs(self_extra - sen2_extra)) +
                                I(abs(self_agree - sen1_agree) - abs(self_agree - sen2_agree)) +
                                I(abs(self_emoti - sen1_emoti) - abs(self_emoti - sen2_emoti))) +
                             scaled_info + 
                             (1|state) + (1|statedistrict),
                             data = subset(cces.both, scaled_info >= median(cces.both$scaled_info, 
                                                                           na.rm = TRUE)))


relative.val.mod.4 <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                                  I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                                  (respondent_AM + I(abs(respondent_AM))) *
                                  (I(sen2_openn - sen1_openn) +
                                  I(sen2_consc - sen1_consc) +
                                  I(sen2_extra - sen1_extra) +
                                  I(sen2_agree - sen1_agree) +
                                  I(sen2_emoti - sen1_emoti)) +
                                  scaled_info + 
                                  (1|state) + (1|statedistrict),
                                  data = cces.both)

relative.val.mod.4.lowinfo <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                             I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                             (respondent_AM + I(abs(respondent_AM))) *
                             (I(sen2_openn - sen1_openn) +
                                I(sen2_consc - sen1_consc) +
                                I(sen2_extra - sen1_extra) +
                                I(sen2_agree - sen1_agree) +
                                I(sen2_emoti - sen1_emoti)) +
                             scaled_info + 
                             (1|state) + (1|statedistrict),
                             data = subset(cces.both, scaled_info < median(cces.both$scaled_info, 
                                                                           na.rm = TRUE)))

relative.val.mod.4.highinfo <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                             I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                             (respondent_AM + I(abs(respondent_AM))) *
                             (I(sen2_openn - sen1_openn) +
                                I(sen2_consc - sen1_consc) +
                                I(sen2_extra - sen1_extra) +
                                I(sen2_agree - sen1_agree) +
                                I(sen2_emoti - sen1_emoti)) +
                             scaled_info + 
                             (1|state) + (1|statedistrict),
                             data = subset(cces.both, scaled_info >= median(cces.both$scaled_info, 
                                                                           na.rm = TRUE)))


relative.big.mod.4 <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                                  I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                                  (respondent_AM + I(abs(respondent_AM))) *
                                  (I(sen2_openn - sen1_openn) +
                                  I(sen2_consc - sen1_consc) +
                                  I(sen2_extra - sen1_extra) +
                                  I(sen2_agree - sen1_agree) +
                                  I(sen2_emoti - sen1_emoti) +
                                  I(abs(self_openn - sen1_openn) - abs(self_openn - sen2_openn)) +
                                  I(abs(self_consc - sen1_consc) - abs(self_consc - sen2_consc)) +
                                  I(abs(self_extra - sen1_extra) - abs(self_extra - sen2_extra)) +
                                  I(abs(self_agree - sen1_agree) - abs(self_agree - sen2_agree)) +
                                  I(abs(self_emoti - sen1_emoti) - abs(self_emoti - sen2_emoti))) +
                                  scaled_info + 
                                  (1|state) + (1|statedistrict),
                                  data = cces.both)

relative.big.mod.4.lowinfo <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                             I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                             (respondent_AM + I(abs(respondent_AM))) *
                             (I(sen2_openn - sen1_openn) +
                                I(sen2_consc - sen1_consc) +
                                I(sen2_extra - sen1_extra) +
                                I(sen2_agree - sen1_agree) +
                                I(sen2_emoti - sen1_emoti) +
                                I(abs(self_openn - sen1_openn) - abs(self_openn - sen2_openn)) +
                                I(abs(self_consc - sen1_consc) - abs(self_consc - sen2_consc)) +
                                I(abs(self_extra - sen1_extra) - abs(self_extra - sen2_extra)) +
                                I(abs(self_agree - sen1_agree) - abs(self_agree - sen2_agree)) +
                                I(abs(self_emoti - sen1_emoti) - abs(self_emoti - sen2_emoti))) +
                             scaled_info + 
                             (1|state) + (1|statedistrict),
                             data = subset(cces.both, scaled_info < median(cces.both$scaled_info, 
                                                                           na.rm = TRUE)))

relative.big.mod.4.highinfo <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                             I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                             (respondent_AM + I(abs(respondent_AM))) *
                             (I(sen2_openn - sen1_openn) +
                                I(sen2_consc - sen1_consc) +
                                I(sen2_extra - sen1_extra) +
                                I(sen2_agree - sen1_agree) +
                                I(sen2_emoti - sen1_emoti) +
                                I(abs(self_openn - sen1_openn) - abs(self_openn - sen2_openn)) +
                                I(abs(self_consc - sen1_consc) - abs(self_consc - sen2_consc)) +
                                I(abs(self_extra - sen1_extra) - abs(self_extra - sen2_extra)) +
                                I(abs(self_agree - sen1_agree) - abs(self_agree - sen2_agree)) +
                                I(abs(self_emoti - sen1_emoti) - abs(self_emoti - sen2_emoti))) +
                             scaled_info + 
                             (1|state) + (1|statedistrict),
                             data = subset(cces.both, scaled_info >= median(cces.both$scaled_info, 
                                                                           na.rm = TRUE)))


relative.con.mod.5 <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                                  I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                                  (respondent_AM + I(abs(respondent_AM))) *
                                  (I(abs(self_openn - sen1_openn) - abs(self_openn - sen2_openn)) +
                                  I(abs(self_consc - sen1_consc) - abs(self_consc - sen2_consc)) +
                                  I(abs(self_extra - sen1_extra) - abs(self_extra - sen2_extra)) +
                                  I(abs(self_agree - sen1_agree) - abs(self_agree - sen2_agree)) +
                                  I(abs(self_emoti - sen1_emoti) - abs(self_emoti - sen2_emoti))) +
                                  scaled_info + 
                                  I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                  I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                  as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                  I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                  sen1cand + sen2cand +
                                  (1|state) + (1|statedistrict),
                                  data = cces.both)

relative.con.mod.5.lowinfo <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                             I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                             (respondent_AM + I(abs(respondent_AM))) *
                             (I(abs(self_openn - sen1_openn) - abs(self_openn - sen2_openn)) +
                                I(abs(self_consc - sen1_consc) - abs(self_consc - sen2_consc)) +
                                I(abs(self_extra - sen1_extra) - abs(self_extra - sen2_extra)) +
                                I(abs(self_agree - sen1_agree) - abs(self_agree - sen2_agree)) +
                                I(abs(self_emoti - sen1_emoti) - abs(self_emoti - sen2_emoti))) +
                             scaled_info + 
                             I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                             I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                             as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                             I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                             sen1cand + sen2cand +
                             (1|state) + (1|statedistrict),
                             data = subset(cces.both, scaled_info < median(cces.both$scaled_info, 
                                                                           na.rm = TRUE)))

relative.con.mod.5.highinfo <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                             I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                             (respondent_AM + I(abs(respondent_AM))) *
                             (I(abs(self_openn - sen1_openn) - abs(self_openn - sen2_openn)) +
                                I(abs(self_consc - sen1_consc) - abs(self_consc - sen2_consc)) +
                                I(abs(self_extra - sen1_extra) - abs(self_extra - sen2_extra)) +
                                I(abs(self_agree - sen1_agree) - abs(self_agree - sen2_agree)) +
                                I(abs(self_emoti - sen1_emoti) - abs(self_emoti - sen2_emoti))) +
                             scaled_info + 
                             I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                             I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                             as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                             I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                             sen1cand + sen2cand +
                             (1|state) + (1|statedistrict),
                             data = subset(cces.both, scaled_info >= median(cces.both$scaled_info, 
                                                                           na.rm = TRUE)))


relative.val.mod.5 <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                                  I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                                  (respondent_AM + I(abs(respondent_AM))) *
                                  (I(sen2_openn - sen1_openn) +
                                  I(sen2_consc - sen1_consc) +
                                  I(sen2_extra - sen1_extra) +
                                  I(sen2_agree - sen1_agree) +
                                  I(sen2_emoti - sen1_emoti)) +
                                  scaled_info + 
                                  I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                  I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                  as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                  I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                  sen1cand + sen2cand +
                                  (1|state) + (1|statedistrict),
                                  data = cces.both)

relative.val.mod.5.lowinfo <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                             I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                             (respondent_AM + I(abs(respondent_AM))) *
                             (I(sen2_openn - sen1_openn) +
                                I(sen2_consc - sen1_consc) +
                                I(sen2_extra - sen1_extra) +
                                I(sen2_agree - sen1_agree) +
                                I(sen2_emoti - sen1_emoti)) +
                             scaled_info + 
                             I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                             I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                             as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                             I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                             sen1cand + sen2cand +
                             (1|state) + (1|statedistrict),
                             data = subset(cces.both, scaled_info < median(cces.both$scaled_info, 
                                                                           na.rm = TRUE)))

relative.val.mod.5.highinfo <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                             I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                             (respondent_AM + I(abs(respondent_AM))) *
                             (I(sen2_openn - sen1_openn) +
                                I(sen2_consc - sen1_consc) +
                                I(sen2_extra - sen1_extra) +
                                I(sen2_agree - sen1_agree) +
                                I(sen2_emoti - sen1_emoti)) +
                             scaled_info + 
                             I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                             I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                             as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                             I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                             sen1cand + sen2cand +
                             (1|state) + (1|statedistrict),
                             data = subset(cces.both, scaled_info >= median(cces.both$scaled_info, 
                                                                           na.rm = TRUE)))

relative.big.mod.5 <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                                  I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                                  (respondent_AM + I(abs(respondent_AM))) *
                                  (I(sen2_openn - sen1_openn) +
                                  I(sen2_consc - sen1_consc) +
                                  I(sen2_extra - sen1_extra) +
                                  I(sen2_agree - sen1_agree) +
                                  I(sen2_emoti - sen1_emoti) +
                                  I(abs(self_openn - sen1_openn) - abs(self_openn - sen2_openn)) +
                                  I(abs(self_consc - sen1_consc) - abs(self_consc - sen2_consc)) +
                                  I(abs(self_extra - sen1_extra) - abs(self_extra - sen2_extra)) +
                                  I(abs(self_agree - sen1_agree) - abs(self_agree - sen2_agree)) +
                                  I(abs(self_emoti - sen1_emoti) - abs(self_emoti - sen2_emoti))) +
                                  scaled_info + 
                                  I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                  I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                  as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                  I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                  sen1cand + sen2cand +
                                  (1|state) + (1|statedistrict),
                                  data = cces.both)

relative.big.mod.5.lowinfo <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                             I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                             (respondent_AM + I(abs(respondent_AM))) *
                             (I(sen2_openn - sen1_openn) +
                                I(sen2_consc - sen1_consc) +
                                I(sen2_extra - sen1_extra) +
                                I(sen2_agree - sen1_agree) +
                                I(sen2_emoti - sen1_emoti) +
                                I(abs(self_openn - sen1_openn) - abs(self_openn - sen2_openn)) +
                                I(abs(self_consc - sen1_consc) - abs(self_consc - sen2_consc)) +
                                I(abs(self_extra - sen1_extra) - abs(self_extra - sen2_extra)) +
                                I(abs(self_agree - sen1_agree) - abs(self_agree - sen2_agree)) +
                                I(abs(self_emoti - sen1_emoti) - abs(self_emoti - sen2_emoti))) +
                             scaled_info + 
                             I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                             I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                             as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                             I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                             sen1cand + sen2cand +
                             (1|state) + (1|statedistrict),
                           data = subset(cces.both, scaled_info < median(cces.both$scaled_info, 
                                                                         na.rm = TRUE)))

relative.big.mod.5.highinfo <- clmm(factor(I(sign(as.numeric(sen2_app2) - as.numeric(sen1_app2)))) ~
                             I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM)) +
                             (respondent_AM + I(abs(respondent_AM))) *
                             (I(sen2_openn - sen1_openn) +
                                I(sen2_consc - sen1_consc) +
                                I(sen2_extra - sen1_extra) +
                                I(sen2_agree - sen1_agree) +
                                I(sen2_emoti - sen1_emoti) +
                                I(abs(self_openn - sen1_openn) - abs(self_openn - sen2_openn)) +
                                I(abs(self_consc - sen1_consc) - abs(self_consc - sen2_consc)) +
                                I(abs(self_extra - sen1_extra) - abs(self_extra - sen2_extra)) +
                                I(abs(self_agree - sen1_agree) - abs(self_agree - sen2_agree)) +
                                I(abs(self_emoti - sen1_emoti) - abs(self_emoti - sen2_emoti))) +
                             scaled_info + 
                             I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                             I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                             as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                             I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                             sen1cand + sen2cand +
                             (1|state) + (1|statedistrict),
                           data = subset(cces.both, scaled_info >= median(cces.both$scaled_info, 
                                                                         na.rm = TRUE)))


### obama models to make sure results hold for one where people probably *can* discern personality


mod.obama.val.1.ordered <- clmm(factor(obama_app2) ~ obama_openn + obama_consc + obama_extra + obama_agree + obama_emoti +
                                  (1|state) + (1|statedistrict),
                                data = newcces_16_merged)

mod.obama.con.1.ordered <- clmm(factor(obama_app2) ~ I(abs(obama_openn - self_openn)) + I(abs(obama_consc - self_consc)) +
                                  I(abs(obama_extra - self_extra)) +
                                  I(abs(obama_agree - self_agree)) + I(abs(obama_emoti - self_emoti)) +
                                  (1|state) + (1|statedistrict),
                                data = newcces_16_merged)

mod.obama.big.1.ordered <- clmm(factor(obama_app2) ~ obama_openn + obama_consc + obama_extra + obama_agree + obama_emoti +
                                  I(abs(obama_openn - self_openn)) + I(abs(obama_consc - self_consc)) +
                                  I(abs(obama_extra - self_extra)) +
                                  I(abs(obama_agree - self_agree)) + I(abs(obama_emoti - self_emoti)) +
                                  (1|state) + (1|statedistrict),
                                data = newcces_16_merged)

mod.obama.val.2.ordered <- clmm(factor(obama_app2) ~ obama_openn + obama_consc + obama_extra + obama_agree + obama_emoti +
                                  I(abs(respondent_AM - obama_AM)) +
                                  (1|state) + (1|statedistrict),
                                data = newcces_16_merged)

mod.obama.con.2.ordered <- clmm(factor(obama_app2) ~ I(abs(obama_openn - self_openn)) + I(abs(obama_consc - self_consc)) +
                                  I(abs(obama_extra - self_extra)) +
                                  I(abs(obama_agree - self_agree)) + I(abs(obama_emoti - self_emoti)) +
                                  I(abs(respondent_AM - obama_AM)) +
                                  (1|state) + (1|statedistrict),
                                data = newcces_16_merged)

mod.obama.big.2.ordered <- clmm(factor(obama_app2) ~ obama_openn + obama_consc + obama_extra + obama_agree + obama_emoti +
                                  I(abs(obama_openn - self_openn)) + I(abs(obama_consc - self_consc)) +
                                  I(abs(obama_extra - self_extra)) +
                                  I(abs(obama_agree - self_agree)) + I(abs(obama_emoti - self_emoti)) +
                                  I(abs(respondent_AM - obama_AM)) +
                                  (1|state) + (1|statedistrict),
                                data = newcces_16_merged)

mod.obama.val.3.ordered <- clmm(factor(obama_app2) ~ (respondent_AM + I(abs(respondent_AM)))*(obama_openn + obama_consc + obama_extra + obama_agree + obama_emoti) +
                                  I(abs(respondent_AM - obama_AM)) +
                                  (1|state) + (1|statedistrict),
                                data = newcces_16_merged)

mod.obama.con.3.ordered <- clmm(factor(obama_app2) ~ (respondent_AM + I(abs(respondent_AM)))*(I(abs(obama_openn - self_openn)) + I(abs(obama_consc - self_consc)) + I(abs(obama_extra - self_extra)) +
                                                                                                I(abs(obama_agree - self_agree)) + I(abs(obama_emoti - self_emoti))) +
                                  I(abs(respondent_AM - obama_AM)) +
                                  (1|state) + (1|statedistrict),
                                data = newcces_16_merged)

mod.obama.big.3.ordered <- clmm(factor(obama_app2) ~ (respondent_AM + I(abs(respondent_AM)))*(obama_openn + obama_consc + obama_extra + obama_agree + obama_emoti +
                                                                                                I(abs(obama_openn - self_openn)) + I(abs(obama_consc - self_consc)) + I(abs(obama_extra - self_extra)) +
                                                                                                I(abs(obama_agree - self_agree)) + I(abs(obama_emoti - self_emoti))) +
                                  I(abs(respondent_AM - obama_AM)) +
                                  (1|state) + (1|statedistrict),
                                data = newcces_16_merged)

mod.obama.val.4.ordered <- clmm(factor(obama_app2) ~ (respondent_AM + I(abs(respondent_AM)))*(obama_openn + obama_consc + obama_extra + obama_agree + obama_emoti) +
                                  scaled_info +
                                  I(abs(respondent_AM - obama_AM)) +
                                  (1|state) + (1|statedistrict),
                                data = newcces_16_merged)

mod.obama.con.4.ordered <- clmm(factor(obama_app2) ~ (respondent_AM + I(abs(respondent_AM)))*(I(abs(obama_openn - self_openn)) + I(abs(obama_consc - self_consc)) + I(abs(obama_extra - self_extra)) +
                                                                                                I(abs(obama_agree - self_agree)) + I(abs(obama_emoti - self_emoti))) +
                                  scaled_info +
                                  I(abs(respondent_AM - obama_AM)) +
                                  (1|state) + (1|statedistrict),
                                data = newcces_16_merged)

mod.obama.big.4.ordered <- clmm(factor(obama_app2) ~ (respondent_AM + I(abs(respondent_AM)))*(obama_openn + obama_consc + obama_extra + obama_agree + obama_emoti +
                                                                                                I(abs(obama_openn - self_openn)) + I(abs(obama_consc - self_consc)) + I(abs(obama_extra - self_extra)) +
                                                                                                I(abs(obama_agree - self_agree)) + I(abs(obama_emoti - self_emoti))) +
                                  scaled_info +
                                  I(abs(respondent_AM - obama_AM)) +
                                  (1|state) + (1|statedistrict),
                                data = newcces_16_merged)


mod.obama.big.5.ordered <- clmm(factor(obama_app2) ~ (respondent_AM + I(abs(respondent_AM)))*(obama_openn + obama_consc + obama_extra + obama_agree + obama_emoti +
                                                                                                I(abs(obama_openn - self_openn)) + I(abs(obama_consc - self_consc)) + I(abs(obama_extra - self_extra)) +
                                                                                                I(abs(obama_agree - self_agree)) + I(abs(obama_emoti - self_emoti))) +
                                  I(abs(respondent_AM - obama_AM)) +
                                  scaled_info +
                                  I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                  I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                  as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                  I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                  (1|state) + (1|statedistrict),
                                data = newcces_16_merged)

mod.obama.con.5.ordered <- clmm(factor(obama_app2) ~  (respondent_AM + I(abs(respondent_AM)))*(I(abs(obama_openn - self_openn)) + I(abs(obama_consc - self_consc)) +
                                                                                                 I(abs(obama_extra - self_extra)) +
                                                                                                 I(abs(obama_agree - self_agree)) + I(abs(obama_emoti - self_emoti))) +
                                  I(abs(respondent_AM - obama_AM)) +
                                  scaled_info +
                                  I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                  I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                  as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                  I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                  (1|state) + (1|statedistrict),
                                data = newcces_16_merged)

mod.obama.val.5.ordered <- clmm(factor(obama_app2) ~  (respondent_AM + I(abs(respondent_AM)))*(obama_openn + obama_consc + obama_extra + obama_agree + obama_emoti) +
                                  I(abs(respondent_AM - obama_AM)) +
                                  scaled_info +
                                  I(gender == "Female") + I(2014 - birthyr) + as.numeric(educ) + I(race == "Black") + newhispanic +
                                  I(race %in% c("Asian","Native American","Mixed","Other","Middle Eastern")) +
                                  as.numeric(faminc_recode) + I(faminc_recode == "Prefer not to say") + I(employ == "Full-time") +
                                  I(employ == "Part-time") + I(employ == "Unemployed") + I(employ == "Retired") +
                                  (1|state) + (1|statedistrict),
                                data = newcces_16_merged)


### senate 2 models as "robustness checks"

mod.sen2.val.1.ordered <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                  cong_extra + cong_agree + 
                                                  cong_emoti +
                                                  (1|state) + (1|statedistrict),
                               data = cces14.sen2)

mod.sen2.con.1.ordered <- clmm(factor(cong_app) ~ I(abs(cong_openn - self_openn)) + 
                                                  I(abs(cong_consc - self_consc)) + 
                                                  I(abs(cong_extra - self_extra)) +
                                                  I(abs(cong_agree - self_agree)) + 
                                                  I(abs(cong_emoti - self_emoti)) +
                                                  (1|state) + (1|statedistrict),
                               data = cces14.sen2)

mod.sen2.big.1.ordered <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                  cong_extra + cong_agree + 
                                                  cong_emoti +
                                                  I(abs(cong_openn - self_openn)) + 
                                                  I(abs(cong_consc - self_consc)) + 
                                                  I(abs(cong_extra - self_extra)) +
                                                  I(abs(cong_agree - self_agree)) + 
                                                  I(abs(cong_emoti - self_emoti)) +
                                                  (1|state) + (1|statedistrict),
                               data = cces14.sen2)

mod.sen2.val.2.ordered <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                  cong_extra + cong_agree + 
                                                  cong_emoti +
                                                  I(abs(respondent_AM - cong_AM)) +
                                                  (1|state) + (1|statedistrict),
                               data = cces14.sen2)

mod.sen2.con.2.ordered <- clmm(factor(cong_app) ~ I(abs(cong_openn - self_openn)) + 
                                                  I(abs(cong_consc - self_consc)) +
                                                  I(abs(cong_extra - self_extra)) +
                                                  I(abs(cong_agree - self_agree)) + 
                                                  I(abs(cong_emoti - self_emoti)) +
                                                  I(abs(respondent_AM - cong_AM)) +
                                                  (1|state) + (1|statedistrict),
                               data = cces14.sen2)

mod.sen2.big.2.ordered <- clmm(factor(cong_app) ~ cong_openn + cong_consc + 
                                                  cong_extra + cong_agree + 
                                                  cong_emoti +
                                                  I(abs(cong_openn - self_openn)) + 
                                                  I(abs(cong_consc - self_consc)) +
                                                  I(abs(cong_extra - self_extra)) +
                                                  I(abs(cong_agree - self_agree)) + 
                                                  I(abs(cong_emoti - self_emoti)) +
                                                  I(abs(respondent_AM - cong_AM)) +
                                                  (1|state) + (1|statedistrict),
                               data = cces14.sen2)

mod.sen2.val.3.ordered <- clmm(factor(cong_app) ~ (respondent_AM + 
                                                   I(abs(respondent_AM)))*(cong_openn + 
                                                                           cong_consc + 
                                                                           cong_extra + 
                                                                           cong_agree + 
                                                                           cong_emoti) +
                                 I(abs(respondent_AM - cong_AM)) +
                                 (1|state) + (1|statedistrict),
                               data = cces14.sen2)

mod.sen2.con.3.ordered <- clmm(factor(cong_app) ~ (respondent_AM + 
                                                   I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) + 
                                                                           I(abs(cong_consc - self_consc)) + 
                                                                           I(abs(cong_extra - self_extra)) +
                                                                           I(abs(cong_agree - self_agree)) + 
                                                                           I(abs(cong_emoti - self_emoti))) +
                                 I(abs(respondent_AM - cong_AM)) +
                                 (1|state) + (1|statedistrict),
                               data = cces14.sen2)

mod.sen2.big.3.ordered <- clmm(factor(cong_app) ~ (respondent_AM + 
                                                   I(abs(respondent_AM)))*(cong_openn + 
                                                                           cong_consc + 
                                                                           cong_extra + 
                                                                           cong_agree + 
                                                                           cong_emoti +
                                                                           I(abs(cong_openn - self_openn)) + 
                                                                           I(abs(cong_consc - self_consc)) + 
                                                                           I(abs(cong_extra - self_extra)) +
                                                                           I(abs(cong_agree - self_agree)) + 
                                                                           I(abs(cong_emoti - self_emoti))) +
                                 I(abs(respondent_AM - cong_AM)) +
                                 (1|state) + (1|statedistrict),
                               data = cces14.sen2)

mod.sen2.val.4.ordered <- clmm(factor(cong_app) ~ (respondent_AM + 
                                                   I(abs(respondent_AM)))*(cong_openn + 
                                                                           cong_consc + 
                                                                           cong_extra + 
                                                                           cong_agree + 
                                                                           cong_emoti) +
                                 scaled_info +
                                 I(abs(respondent_AM - cong_AM)) +
                                 (1|state) + (1|statedistrict),
                               data = cces14.sen2)

mod.sen2.con.4.ordered <- clmm(factor(cong_app) ~ (respondent_AM + 
                                                   I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) + 
                                                                           I(abs(cong_consc - self_consc)) + 
                                                                           I(abs(cong_extra - self_extra)) +
                                                                           I(abs(cong_agree - self_agree)) + 
                                                                           I(abs(cong_emoti - self_emoti))) +
                                 scaled_info +
                                 I(abs(respondent_AM - cong_AM)) +
                                 (1|state) + (1|statedistrict),
                               data = cces14.sen2)

mod.sen2.big.4.ordered <- clmm(factor(cong_app) ~ (respondent_AM + 
                                                   I(abs(respondent_AM)))*(cong_openn + 
                                                                           cong_consc + 
                                                                           cong_extra + 
                                                                           cong_agree + 
                                                                           cong_emoti +
                                                                           I(abs(cong_openn - self_openn)) + 
                                                                           I(abs(cong_consc - self_consc)) + 
                                                                           I(abs(cong_extra - self_extra)) +
                                                                           I(abs(cong_agree - self_agree)) + 
                                                                           I(abs(cong_emoti - self_emoti))) +
                                 scaled_info +
                                 I(abs(respondent_AM - cong_AM)) +
                                 (1|state) + (1|statedistrict),
                               data = cces14.sen2)


mod.sen2.big.5.ordered <- clmm(factor(cong_app) ~ (respondent_AM + 
                                                   I(abs(respondent_AM)))*(cong_openn + 
                                                                           cong_consc + 
                                                                           cong_extra + 
                                                                           cong_agree + 
                                                                           cong_emoti +
                                                                           I(abs(cong_openn - self_openn)) + 
                                                                           I(abs(cong_consc - self_consc)) + 
                                                                           I(abs(cong_extra - self_extra)) +
                                                                           I(abs(cong_agree - self_agree)) + 
                                                                           I(abs(cong_emoti - self_emoti))) +
                                 I(abs(respondent_AM - cong_AM)) +
                                 scaled_info +
                                 I(gender == "Female") + I(2014 - birthyr) + 
                                 as.numeric(educ) + 
                                 I(race == "Black") + newhispanic +
                                 I(race %in% c("Asian","Native American",
                                               "Mixed","Other","Middle Eastern")) +
                                 as.numeric(faminc_recode) + 
                                 I(faminc_recode == "Prefer not to say") + 
                                 I(employ == "Full-time") +
                                 I(employ == "Part-time") + 
                                 I(employ == "Unemployed") + 
                                 I(employ == "Retired") +
                                 (1|state) + (1|statedistrict),
                               data = cces14.sen2)

mod.sen2.con.5.ordered <- clmm(factor(cong_app) ~  (respondent_AM + 
                                                    I(abs(respondent_AM)))*(I(abs(cong_openn - self_openn)) + 
                                                                            I(abs(cong_consc - self_consc)) +
                                                                            I(abs(cong_extra - self_extra)) +
                                                                            I(abs(cong_agree - self_agree)) + 
                                                                            I(abs(cong_emoti - self_emoti))) +
                                 I(abs(respondent_AM - cong_AM)) +
                                 scaled_info +
                                 I(gender == "Female") + I(2014 - birthyr) + 
                                 as.numeric(educ) + 
                                 I(race == "Black") + newhispanic +
                                 I(race %in% c("Asian","Native American",
                                               "Mixed","Other","Middle Eastern")) +
                                 as.numeric(faminc_recode) + 
                                 I(faminc_recode == "Prefer not to say") + 
                                 I(employ == "Full-time") +
                                 I(employ == "Part-time") + 
                                 I(employ == "Unemployed") + 
                                 I(employ == "Retired") +
                                 (1|state) + (1|statedistrict),
                               data = cces14.sen2)

mod.sen2.val.5.ordered <- clmm(factor(cong_app) ~  (respondent_AM + 
                                                    I(abs(respondent_AM)))*(cong_openn + 
                                                                            cong_consc + 
                                                                            cong_extra + 
                                                                            cong_agree + 
                                                                            cong_emoti) +
                                 I(abs(respondent_AM - cong_AM)) +
                                 scaled_info +
                                 I(gender == "Female") + 
                                 I(2014 - birthyr) + as.numeric(educ) + 
                                 I(race == "Black") + newhispanic +
                                 I(race %in% c("Asian","Native American",
                                               "Mixed","Other","Middle Eastern")) +
                                 as.numeric(faminc_recode) + 
                                 I(faminc_recode == "Prefer not to say") + 
                                 I(employ == "Full-time") +
                                 I(employ == "Part-time") + 
                                 I(employ == "Unemployed") + 
                                 I(employ == "Retired") +
                                 (1|state) + (1|statedistrict),
                               data = cces14.sen2)


wilay.mods <- list(mod.all.big.1.ordered,  
                   mod.rep.big.1.ordered,  
                   mod.sen.big.1.ordered,  
                   mod.all.con.1.ordered,  
                   mod.rep.con.1.ordered,  
                   mod.sen.con.1.ordered,  
                   mod.all.val.1.ordered,  
                   mod.rep.val.1.ordered,  
                   mod.sen.val.1.ordered,  
                   mod.all.big.2.ordered,  
                   mod.rep.big.2.ordered,  
                   mod.sen.big.2.ordered,  
                   mod.all.con.2.ordered,  
                   mod.rep.con.2.ordered,  
                   mod.sen.con.2.ordered,  
                   mod.all.val.2.ordered,  
                   mod.rep.val.2.ordered,  
                   mod.sen.val.2.ordered,  
                   mod.all.big.3.ordered,  
                   mod.rep.big.3.ordered,  
                   mod.sen.big.3.ordered,  
                   mod.all.con.3.ordered,  
                   mod.rep.con.3.ordered,  
                   mod.sen.con.3.ordered,  
                   mod.all.val.3.ordered,  
                   mod.rep.val.3.ordered,  
                   mod.sen.val.3.ordered,  
                   mod.all.big.4.ordered,  
                   mod.rep.big.4.ordered,  
                   mod.sen.big.4.ordered,  
                   mod.all.con.4.ordered,  
                   mod.rep.con.4.ordered,  
                   mod.sen.con.4.ordered,  
                   mod.all.val.4.ordered,  
                   mod.rep.val.4.ordered,  
                   mod.sen.val.4.ordered,  
                   mod.all.big.5.ordered,  
                   mod.rep.big.5.ordered,  
                   mod.sen.big.5.ordered,  
                   mod.all.con.5.ordered,  
                   mod.rep.con.5.ordered,  
                   mod.sen.con.5.ordered,  
                   mod.all.val.5.ordered,  
                   mod.rep.val.5.ordered,  
                   mod.sen.val.5.ordered,  
                   mod.all.big.1.ordered.copartisan, 
                   mod.rep.big.1.ordered.copartisan, 
                   mod.sen.big.1.ordered.copartisan, 
                   mod.all.con.1.ordered.copartisan, 
                   mod.rep.con.1.ordered.copartisan, 
                   mod.sen.con.1.ordered.copartisan, 
                   mod.all.val.1.ordered.copartisan, 
                   mod.rep.val.1.ordered.copartisan, 
                   mod.sen.val.1.ordered.copartisan, 
                   mod.all.big.2.ordered.copartisan, 
                   mod.rep.big.2.ordered.copartisan, 
                   mod.sen.big.2.ordered.copartisan, 
                   mod.all.con.2.ordered.copartisan, 
                   mod.rep.con.2.ordered.copartisan, 
                   mod.sen.con.2.ordered.copartisan, 
                   mod.all.val.2.ordered.copartisan, 
                   mod.rep.val.2.ordered.copartisan, 
                   mod.sen.val.2.ordered.copartisan, 
                   mod.all.big.3.ordered.copartisan, 
                   mod.rep.big.3.ordered.copartisan, 
                   mod.sen.big.3.ordered.copartisan, 
                   mod.all.con.3.ordered.copartisan, 
                   mod.rep.con.3.ordered.copartisan, 
                   mod.sen.con.3.ordered.copartisan, 
                   mod.all.val.3.ordered.copartisan, 
                   mod.rep.val.3.ordered.copartisan, 
                   mod.sen.val.3.ordered.copartisan, 
                   mod.all.big.4.ordered.copartisan, 
                   mod.rep.big.4.ordered.copartisan, 
                   mod.sen.big.4.ordered.copartisan, 
                   mod.all.con.4.ordered.copartisan, 
                   mod.rep.con.4.ordered.copartisan, 
                   mod.sen.con.4.ordered.copartisan, 
                   mod.all.val.4.ordered.copartisan, 
                   mod.rep.val.4.ordered.copartisan, 
                   mod.sen.val.4.ordered.copartisan, 
                   mod.all.big.5.ordered.copartisan, 
                   mod.rep.big.5.ordered.copartisan, 
                   mod.sen.big.5.ordered.copartisan, 
                   mod.all.con.5.ordered.copartisan, 
                   mod.rep.con.5.ordered.copartisan, 
                   mod.sen.con.5.ordered.copartisan, 
                   mod.all.val.5.ordered.copartisan, 
                   mod.rep.val.5.ordered.copartisan, 
                   mod.sen.val.5.ordered.copartisan, 
                   mod.all.big.1.ordered.nopartisan, 
                   mod.rep.big.1.ordered.nopartisan, 
                   mod.sen.big.1.ordered.nopartisan, 
                   mod.all.con.1.ordered.nopartisan, 
                   mod.rep.con.1.ordered.nopartisan, 
                   mod.sen.con.1.ordered.nopartisan, 
                   mod.all.val.1.ordered.nopartisan, 
                   mod.rep.val.1.ordered.nopartisan, 
                   mod.sen.val.1.ordered.nopartisan, 
                   mod.all.big.2.ordered.nopartisan, 
                   mod.rep.big.2.ordered.nopartisan, 
                   mod.sen.big.2.ordered.nopartisan, 
                   mod.all.con.2.ordered.nopartisan, 
                   mod.rep.con.2.ordered.nopartisan, 
                   mod.sen.con.2.ordered.nopartisan, 
                   mod.all.val.2.ordered.nopartisan, 
                   mod.rep.val.2.ordered.nopartisan, 
                   mod.sen.val.2.ordered.nopartisan, 
                   mod.all.big.3.ordered.nopartisan, 
                   mod.rep.big.3.ordered.nopartisan, 
                   mod.sen.big.3.ordered.nopartisan, 
                   mod.all.con.3.ordered.nopartisan, 
                   mod.rep.con.3.ordered.nopartisan, 
                   mod.sen.con.3.ordered.nopartisan, 
                   mod.all.val.3.ordered.nopartisan, 
                   mod.rep.val.3.ordered.nopartisan, 
                   mod.sen.val.3.ordered.nopartisan, 
                   mod.all.big.4.ordered.nopartisan, 
                   mod.rep.big.4.ordered.nopartisan, 
                   mod.sen.big.4.ordered.nopartisan, 
                   mod.all.con.4.ordered.nopartisan, 
                   mod.rep.con.4.ordered.nopartisan, 
                   mod.sen.con.4.ordered.nopartisan, 
                   mod.all.val.4.ordered.nopartisan, 
                   mod.rep.val.4.ordered.nopartisan, 
                   mod.sen.val.4.ordered.nopartisan, 
                   mod.all.big.5.ordered.nopartisan, 
                   mod.rep.big.5.ordered.nopartisan, 
                   mod.sen.big.5.ordered.nopartisan, 
                   mod.all.con.5.ordered.nopartisan, 
                   mod.rep.con.5.ordered.nopartisan, 
                   mod.sen.con.5.ordered.nopartisan, 
                   mod.all.val.5.ordered.nopartisan, 
                   mod.rep.val.5.ordered.nopartisan, 
                   mod.sen.val.5.ordered.nopartisan, 
                   mod.all.big.1.ordered.lowinfo,
                   mod.rep.big.1.ordered.lowinfo,
                   mod.sen.big.1.ordered.lowinfo,
                   mod.all.con.1.ordered.lowinfo,
                   mod.rep.con.1.ordered.lowinfo,
                   mod.sen.con.1.ordered.lowinfo,
                   mod.all.val.1.ordered.lowinfo,
                   mod.rep.val.1.ordered.lowinfo,
                   mod.sen.val.1.ordered.lowinfo,
                   mod.all.big.2.ordered.lowinfo,
                   mod.rep.big.2.ordered.lowinfo,
                   mod.sen.big.2.ordered.lowinfo,
                   mod.all.con.2.ordered.lowinfo,
                   mod.rep.con.2.ordered.lowinfo,
                   mod.sen.con.2.ordered.lowinfo,
                   mod.all.val.2.ordered.lowinfo,
                   mod.rep.val.2.ordered.lowinfo,
                   mod.sen.val.2.ordered.lowinfo,
                   mod.all.big.3.ordered.lowinfo,
                   mod.rep.big.3.ordered.lowinfo,
                   mod.sen.big.3.ordered.lowinfo,
                   mod.all.con.3.ordered.lowinfo,
                   mod.rep.con.3.ordered.lowinfo,
                   mod.sen.con.3.ordered.lowinfo,
                   mod.all.val.3.ordered.lowinfo,
                   mod.rep.val.3.ordered.lowinfo,
                   mod.sen.val.3.ordered.lowinfo,
                   mod.all.big.4.ordered.lowinfo,
                   mod.rep.big.4.ordered.lowinfo,
                   mod.sen.big.4.ordered.lowinfo,
                   mod.all.con.4.ordered.lowinfo,
                   mod.rep.con.4.ordered.lowinfo,
                   mod.sen.con.4.ordered.lowinfo,
                   mod.all.val.4.ordered.lowinfo,
                   mod.rep.val.4.ordered.lowinfo,
                   mod.sen.val.4.ordered.lowinfo,
                   mod.all.big.5.ordered.lowinfo,
                   mod.rep.big.5.ordered.lowinfo,
                   mod.sen.big.5.ordered.lowinfo,
                   mod.all.con.5.ordered.lowinfo,
                   mod.rep.con.5.ordered.lowinfo,
                   mod.sen.con.5.ordered.lowinfo,
                   mod.all.val.5.ordered.lowinfo,
                   mod.rep.val.5.ordered.lowinfo,
                   mod.sen.val.5.ordered.lowinfo,
                   mod.all.big.1.ordered.highinfo,
                   mod.rep.big.1.ordered.highinfo,
                   mod.sen.big.1.ordered.highinfo,
                   mod.all.con.1.ordered.highinfo,
                   mod.rep.con.1.ordered.highinfo,
                   mod.sen.con.1.ordered.highinfo,
                   mod.all.val.1.ordered.highinfo,
                   mod.rep.val.1.ordered.highinfo,
                   mod.sen.val.1.ordered.highinfo,
                   mod.all.big.2.ordered.highinfo,
                   mod.rep.big.2.ordered.highinfo,
                   mod.sen.big.2.ordered.highinfo,
                   mod.all.con.2.ordered.highinfo,
                   mod.rep.con.2.ordered.highinfo,
                   mod.sen.con.2.ordered.highinfo,
                   mod.all.val.2.ordered.highinfo,
                   mod.rep.val.2.ordered.highinfo,
                   mod.sen.val.2.ordered.highinfo,
                   mod.all.big.3.ordered.highinfo,
                   mod.rep.big.3.ordered.highinfo,
                   mod.sen.big.3.ordered.highinfo,
                   mod.all.con.3.ordered.highinfo,
                   mod.rep.con.3.ordered.highinfo,
                   mod.sen.con.3.ordered.highinfo,
                   mod.all.val.3.ordered.highinfo,
                   mod.rep.val.3.ordered.highinfo,
                   mod.sen.val.3.ordered.highinfo,
                   mod.all.big.4.ordered.highinfo,
                   mod.rep.big.4.ordered.highinfo,
                   mod.sen.big.4.ordered.highinfo,
                   mod.all.con.4.ordered.highinfo,
                   mod.rep.con.4.ordered.highinfo,
                   mod.sen.con.4.ordered.highinfo,
                   mod.all.val.4.ordered.highinfo,
                   mod.rep.val.4.ordered.highinfo,
                   mod.sen.val.4.ordered.highinfo,
                   mod.all.big.5.ordered.highinfo,
                   mod.rep.big.5.ordered.highinfo,
                   mod.sen.big.5.ordered.highinfo,
                   mod.all.con.5.ordered.highinfo,
                   mod.rep.con.5.ordered.highinfo,
                   mod.sen.con.5.ordered.highinfo,
                   mod.all.val.5.ordered.highinfo,
                   mod.rep.val.5.ordered.highinfo,
                   mod.sen.val.5.ordered.highinfo,
                   relative.con.mod.1,
                   relative.val.mod.1,
                   relative.big.mod.1,
                   relative.con.mod.2,
                   relative.val.mod.2,
                   relative.big.mod.2,
                   relative.con.mod.3,
                   relative.val.mod.3,
                   relative.big.mod.3,
                   relative.con.mod.4,
                   relative.val.mod.4,
                   relative.big.mod.4,
                   relative.con.mod.5,
                   relative.val.mod.5,
                   relative.big.mod.5,
                   relative.con.mod.1.lowinfo,
                   relative.val.mod.1.lowinfo,
                   relative.big.mod.1.lowinfo,
                   relative.con.mod.2.lowinfo,
                   relative.val.mod.2.lowinfo,
                   relative.big.mod.2.lowinfo,
                   relative.con.mod.3.lowinfo,
                   relative.val.mod.3.lowinfo,
                   relative.big.mod.3.lowinfo,
                   relative.con.mod.4.lowinfo,
                   relative.val.mod.4.lowinfo,
                   relative.big.mod.4.lowinfo,
                   relative.con.mod.5.lowinfo,
                   relative.val.mod.5.lowinfo,
                   relative.big.mod.5.lowinfo,  
                   relative.con.mod.1.highinfo,
                   relative.val.mod.1.highinfo,
                   relative.big.mod.1.highinfo,
                   relative.con.mod.2.highinfo,
                   relative.val.mod.2.highinfo,
                   relative.big.mod.2.highinfo,
                   relative.con.mod.3.highinfo,
                   relative.val.mod.3.highinfo,
                   relative.big.mod.3.highinfo,
                   relative.con.mod.4.highinfo,
                   relative.val.mod.4.highinfo,
                   relative.big.mod.4.highinfo,
                   relative.con.mod.5.highinfo,
                   relative.val.mod.5.highinfo,
                   relative.big.mod.5.highinfo,
                   mod.obama.big.1.ordered,
                   mod.obama.con.1.ordered,
                   mod.obama.val.1.ordered,
                   mod.obama.big.2.ordered,
                   mod.obama.con.2.ordered,
                   mod.obama.val.2.ordered,
                   mod.obama.big.3.ordered,
                   mod.obama.con.3.ordered,
                   mod.obama.val.3.ordered,
                   mod.obama.big.4.ordered,
                   mod.obama.con.4.ordered,
                   mod.obama.val.4.ordered,
                   mod.obama.big.5.ordered,
                   mod.obama.con.5.ordered,
                   mod.obama.val.5.ordered,
                   mod.sen2.big.1.ordered,
                   mod.sen2.con.1.ordered,
                   mod.sen2.val.1.ordered,
                   mod.sen2.big.2.ordered,
                   mod.sen2.con.2.ordered,
                   mod.sen2.val.2.ordered,
                   mod.sen2.big.3.ordered,
                   mod.sen2.con.3.ordered,
                   mod.sen2.val.3.ordered,
                   mod.sen2.big.4.ordered,
                   mod.sen2.con.4.ordered,
                   mod.sen2.val.4.ordered,
                   mod.sen2.big.5.ordered,
                   mod.sen2.con.5.ordered,
                   mod.sen2.val.5.ordered)

# save the models to a file
save(wilay.mods, file = "WilayMods.Rda")
# load("WilayMods.Rda")

# if loading the files from a file, to create the objects
obj.names <- c('mod.all.big.1.ordered',  
               'mod.rep.big.1.ordered',  
               'mod.sen.big.1.ordered',  
               'mod.all.con.1.ordered',  
               'mod.rep.con.1.ordered',  
               'mod.sen.con.1.ordered',  
               'mod.all.val.1.ordered',  
               'mod.rep.val.1.ordered',  
               'mod.sen.val.1.ordered',  
               'mod.all.big.2.ordered',  
               'mod.rep.big.2.ordered',  
               'mod.sen.big.2.ordered',  
               'mod.all.con.2.ordered',  
               'mod.rep.con.2.ordered',  
               'mod.sen.con.2.ordered',  
               'mod.all.val.2.ordered',  
               'mod.rep.val.2.ordered',  
               'mod.sen.val.2.ordered',  
               'mod.all.big.3.ordered',  
               'mod.rep.big.3.ordered',  
               'mod.sen.big.3.ordered',  
               'mod.all.con.3.ordered',  
               'mod.rep.con.3.ordered',  
               'mod.sen.con.3.ordered',  
               'mod.all.val.3.ordered',  
               'mod.rep.val.3.ordered',  
               'mod.sen.val.3.ordered',  
               'mod.all.big.4.ordered',  
               'mod.rep.big.4.ordered',  
               'mod.sen.big.4.ordered',  
               'mod.all.con.4.ordered',  
               'mod.rep.con.4.ordered',  
               'mod.sen.con.4.ordered',  
               'mod.all.val.4.ordered',  
               'mod.rep.val.4.ordered',  
               'mod.sen.val.4.ordered',  
               'mod.all.big.5.ordered',  
               'mod.rep.big.5.ordered',  
               'mod.sen.big.5.ordered',  
               'mod.all.con.5.ordered',  
               'mod.rep.con.5.ordered',  
               'mod.sen.con.5.ordered',  
               'mod.all.val.5.ordered',  
               'mod.rep.val.5.ordered',  
               'mod.sen.val.5.ordered',  
               'mod.all.big.1.ordered.copartisan', 
               'mod.rep.big.1.ordered.copartisan', 
               'mod.sen.big.1.ordered.copartisan', 
               'mod.all.con.1.ordered.copartisan', 
               'mod.rep.con.1.ordered.copartisan', 
               'mod.sen.con.1.ordered.copartisan', 
               'mod.all.val.1.ordered.copartisan', 
               'mod.rep.val.1.ordered.copartisan', 
               'mod.sen.val.1.ordered.copartisan', 
               'mod.all.big.2.ordered.copartisan', 
               'mod.rep.big.2.ordered.copartisan', 
               'mod.sen.big.2.ordered.copartisan', 
               'mod.all.con.2.ordered.copartisan', 
               'mod.rep.con.2.ordered.copartisan', 
               'mod.sen.con.2.ordered.copartisan', 
               'mod.all.val.2.ordered.copartisan', 
               'mod.rep.val.2.ordered.copartisan', 
               'mod.sen.val.2.ordered.copartisan', 
               'mod.all.big.3.ordered.copartisan', 
               'mod.rep.big.3.ordered.copartisan', 
               'mod.sen.big.3.ordered.copartisan', 
               'mod.all.con.3.ordered.copartisan', 
               'mod.rep.con.3.ordered.copartisan', 
               'mod.sen.con.3.ordered.copartisan', 
               'mod.all.val.3.ordered.copartisan', 
               'mod.rep.val.3.ordered.copartisan', 
               'mod.sen.val.3.ordered.copartisan', 
               'mod.all.big.4.ordered.copartisan', 
               'mod.rep.big.4.ordered.copartisan', 
               'mod.sen.big.4.ordered.copartisan', 
               'mod.all.con.4.ordered.copartisan', 
               'mod.rep.con.4.ordered.copartisan', 
               'mod.sen.con.4.ordered.copartisan', 
               'mod.all.val.4.ordered.copartisan', 
               'mod.rep.val.4.ordered.copartisan', 
               'mod.sen.val.4.ordered.copartisan', 
               'mod.all.big.5.ordered.copartisan', 
               'mod.rep.big.5.ordered.copartisan', 
               'mod.sen.big.5.ordered.copartisan', 
               'mod.all.con.5.ordered.copartisan', 
               'mod.rep.con.5.ordered.copartisan', 
               'mod.sen.con.5.ordered.copartisan', 
               'mod.all.val.5.ordered.copartisan', 
               'mod.rep.val.5.ordered.copartisan', 
               'mod.sen.val.5.ordered.copartisan', 
               'mod.all.big.1.ordered.nopartisan', 
               'mod.rep.big.1.ordered.nopartisan', 
               'mod.sen.big.1.ordered.nopartisan', 
               'mod.all.con.1.ordered.nopartisan', 
               'mod.rep.con.1.ordered.nopartisan', 
               'mod.sen.con.1.ordered.nopartisan', 
               'mod.all.val.1.ordered.nopartisan', 
               'mod.rep.val.1.ordered.nopartisan', 
               'mod.sen.val.1.ordered.nopartisan', 
               'mod.all.big.2.ordered.nopartisan', 
               'mod.rep.big.2.ordered.nopartisan', 
               'mod.sen.big.2.ordered.nopartisan', 
               'mod.all.con.2.ordered.nopartisan', 
               'mod.rep.con.2.ordered.nopartisan', 
               'mod.sen.con.2.ordered.nopartisan', 
               'mod.all.val.2.ordered.nopartisan', 
               'mod.rep.val.2.ordered.nopartisan', 
               'mod.sen.val.2.ordered.nopartisan', 
               'mod.all.big.3.ordered.nopartisan', 
               'mod.rep.big.3.ordered.nopartisan', 
               'mod.sen.big.3.ordered.nopartisan', 
               'mod.all.con.3.ordered.nopartisan', 
               'mod.rep.con.3.ordered.nopartisan', 
               'mod.sen.con.3.ordered.nopartisan', 
               'mod.all.val.3.ordered.nopartisan', 
               'mod.rep.val.3.ordered.nopartisan', 
               'mod.sen.val.3.ordered.nopartisan', 
               'mod.all.big.4.ordered.nopartisan', 
               'mod.rep.big.4.ordered.nopartisan', 
               'mod.sen.big.4.ordered.nopartisan', 
               'mod.all.con.4.ordered.nopartisan', 
               'mod.rep.con.4.ordered.nopartisan', 
               'mod.sen.con.4.ordered.nopartisan', 
               'mod.all.val.4.ordered.nopartisan', 
               'mod.rep.val.4.ordered.nopartisan', 
               'mod.sen.val.4.ordered.nopartisan', 
               'mod.all.big.5.ordered.nopartisan', 
               'mod.rep.big.5.ordered.nopartisan', 
               'mod.sen.big.5.ordered.nopartisan', 
               'mod.all.con.5.ordered.nopartisan', 
               'mod.rep.con.5.ordered.nopartisan', 
               'mod.sen.con.5.ordered.nopartisan', 
               'mod.all.val.5.ordered.nopartisan', 
               'mod.rep.val.5.ordered.nopartisan', 
               'mod.sen.val.5.ordered.nopartisan', 
               'mod.all.big.1.ordered.lowinfo',
               'mod.rep.big.1.ordered.lowinfo',
               'mod.sen.big.1.ordered.lowinfo',
               'mod.all.con.1.ordered.lowinfo',
               'mod.rep.con.1.ordered.lowinfo',
               'mod.sen.con.1.ordered.lowinfo',
               'mod.all.val.1.ordered.lowinfo',
               'mod.rep.val.1.ordered.lowinfo',
               'mod.sen.val.1.ordered.lowinfo',
               'mod.all.big.2.ordered.lowinfo',
               'mod.rep.big.2.ordered.lowinfo',
               'mod.sen.big.2.ordered.lowinfo',
               'mod.all.con.2.ordered.lowinfo',
               'mod.rep.con.2.ordered.lowinfo',
               'mod.sen.con.2.ordered.lowinfo',
               'mod.all.val.2.ordered.lowinfo',
               'mod.rep.val.2.ordered.lowinfo',
               'mod.sen.val.2.ordered.lowinfo',
               'mod.all.big.3.ordered.lowinfo',
               'mod.rep.big.3.ordered.lowinfo',
               'mod.sen.big.3.ordered.lowinfo',
               'mod.all.con.3.ordered.lowinfo',
               'mod.rep.con.3.ordered.lowinfo',
               'mod.sen.con.3.ordered.lowinfo',
               'mod.all.val.3.ordered.lowinfo',
               'mod.rep.val.3.ordered.lowinfo',
               'mod.sen.val.3.ordered.lowinfo',
               'mod.all.big.4.ordered.lowinfo',
               'mod.rep.big.4.ordered.lowinfo',
               'mod.sen.big.4.ordered.lowinfo',
               'mod.all.con.4.ordered.lowinfo',
               'mod.rep.con.4.ordered.lowinfo',
               'mod.sen.con.4.ordered.lowinfo',
               'mod.all.val.4.ordered.lowinfo',
               'mod.rep.val.4.ordered.lowinfo',
               'mod.sen.val.4.ordered.lowinfo',
               'mod.all.big.5.ordered.lowinfo',
               'mod.rep.big.5.ordered.lowinfo',
               'mod.sen.big.5.ordered.lowinfo',
               'mod.all.con.5.ordered.lowinfo',
               'mod.rep.con.5.ordered.lowinfo',
               'mod.sen.con.5.ordered.lowinfo',
               'mod.all.val.5.ordered.lowinfo',
               'mod.rep.val.5.ordered.lowinfo',
               'mod.sen.val.5.ordered.lowinfo',
               'mod.all.big.1.ordered.highinfo',
               'mod.rep.big.1.ordered.highinfo',
               'mod.sen.big.1.ordered.highinfo',
               'mod.all.con.1.ordered.highinfo',
               'mod.rep.con.1.ordered.highinfo',
               'mod.sen.con.1.ordered.highinfo',
               'mod.all.val.1.ordered.highinfo',
               'mod.rep.val.1.ordered.highinfo',
               'mod.sen.val.1.ordered.highinfo',
               'mod.all.big.2.ordered.highinfo',
               'mod.rep.big.2.ordered.highinfo',
               'mod.sen.big.2.ordered.highinfo',
               'mod.all.con.2.ordered.highinfo',
               'mod.rep.con.2.ordered.highinfo',
               'mod.sen.con.2.ordered.highinfo',
               'mod.all.val.2.ordered.highinfo',
               'mod.rep.val.2.ordered.highinfo',
               'mod.sen.val.2.ordered.highinfo',
               'mod.all.big.3.ordered.highinfo',
               'mod.rep.big.3.ordered.highinfo',
               'mod.sen.big.3.ordered.highinfo',
               'mod.all.con.3.ordered.highinfo',
               'mod.rep.con.3.ordered.highinfo',
               'mod.sen.con.3.ordered.highinfo',
               'mod.all.val.3.ordered.highinfo',
               'mod.rep.val.3.ordered.highinfo',
               'mod.sen.val.3.ordered.highinfo',
               'mod.all.big.4.ordered.highinfo',
               'mod.rep.big.4.ordered.highinfo',
               'mod.sen.big.4.ordered.highinfo',
               'mod.all.con.4.ordered.highinfo',
               'mod.rep.con.4.ordered.highinfo',
               'mod.sen.con.4.ordered.highinfo',
               'mod.all.val.4.ordered.highinfo',
               'mod.rep.val.4.ordered.highinfo',
               'mod.sen.val.4.ordered.highinfo',
               'mod.all.big.5.ordered.highinfo',
               'mod.rep.big.5.ordered.highinfo',
               'mod.sen.big.5.ordered.highinfo',
               'mod.all.con.5.ordered.highinfo',
               'mod.rep.con.5.ordered.highinfo',
               'mod.sen.con.5.ordered.highinfo',
               'mod.all.val.5.ordered.highinfo',
               'mod.rep.val.5.ordered.highinfo',
               'mod.sen.val.5.ordered.highinfo',
               'relative.con.mod.1',
               'relative.val.mod.1',
               'relative.big.mod.1',
               'relative.con.mod.2',
               'relative.val.mod.2',
               'relative.big.mod.2',
               'relative.con.mod.3',
               'relative.val.mod.3',
               'relative.big.mod.3',
               'relative.con.mod.4',
               'relative.val.mod.4',
               'relative.big.mod.4',
               'relative.con.mod.5',
               'relative.val.mod.5',
               'relative.big.mod.5',
               'relative.con.mod.1.lowinfo',
               'relative.val.mod.1.lowinfo',
               'relative.big.mod.1.lowinfo',
               'relative.con.mod.2.lowinfo',
               'relative.val.mod.2.lowinfo',
               'relative.big.mod.2.lowinfo',
               'relative.con.mod.3.lowinfo',
               'relative.val.mod.3.lowinfo',
               'relative.big.mod.3.lowinfo',
               'relative.con.mod.4.lowinfo',
               'relative.val.mod.4.lowinfo',
               'relative.big.mod.4.lowinfo',
               'relative.con.mod.5.lowinfo',
               'relative.val.mod.5.lowinfo',
               'relative.big.mod.5.lowinfo',  
               'relative.con.mod.1.highinfo',
               'relative.val.mod.1.highinfo',
               'relative.big.mod.1.highinfo',
               'relative.con.mod.2.highinfo',
               'relative.val.mod.2.highinfo',
               'relative.big.mod.2.highinfo',
               'relative.con.mod.3.highinfo',
               'relative.val.mod.3.highinfo',
               'relative.big.mod.3.highinfo',
               'relative.con.mod.4.highinfo',
               'relative.val.mod.4.highinfo',
               'relative.big.mod.4.highinfo',
               'relative.con.mod.5.highinfo',
               'relative.val.mod.5.highinfo',
               'relative.big.mod.5.highinfo',
               'mod.obama.big.1.ordered',
               'mod.obama.con.1.ordered',
               'mod.obama.val.1.ordered',
               'mod.obama.big.2.ordered',
               'mod.obama.con.2.ordered',
               'mod.obama.val.2.ordered',
               'mod.obama.big.3.ordered',
               'mod.obama.con.3.ordered',
               'mod.obama.val.3.ordered',
               'mod.obama.big.4.ordered',
               'mod.obama.con.4.ordered',
               'mod.obama.val.4.ordered',
               'mod.obama.big.5.ordered',
               'mod.obama.con.5.ordered',
               'mod.obama.val.5.ordered',
               'mod.sen2.big.1.ordered',
               'mod.sen2.con.1.ordered',
               'mod.sen2.val.1.ordered',
               'mod.sen2.big.2.ordered',
               'mod.sen2.con.2.ordered',
               'mod.sen2.val.2.ordered',
               'mod.sen2.big.3.ordered',
               'mod.sen2.con.3.ordered',
               'mod.sen2.val.3.ordered',
               'mod.sen2.big.4.ordered',
               'mod.sen2.con.4.ordered',
               'mod.sen2.val.4.ordered',
               'mod.sen2.big.5.ordered',
               'mod.sen2.con.5.ordered',
               'mod.sen2.val.5.ordered')         

# unpacking the saved models
for(i in 1:length(obj.names)){
  assign(obj.names[i],  wilay.mods[[i]])
}
               
# clarke test function for model testing          
manualclarke_clmm <- function(model1, model2){
	numobs <- model1$dims$nobs
	model1coefs <- length(model1$coefficients)
	model2coefs <- length(model2$coefficients)	
	model1logliks <- log(fitted(model1))
	model2logliks <- log(fitted(model2))
	correction <- (model1coefs - model2coefs) * (log(numobs) / (2*numobs))
	stat <- sum((model1logliks - model2logliks) > correction)
    ans <- list(stat = stat/numobs,
                p = 1 - sum(dbinom(1:stat, numobs, 0.5))   # if p small, model 1 better
               )
	return(ans)
	}

# vuong test function for model testing          
manualvuong_clmm <- function(model1, model2){
	numobs <- model1$dims$nobs
	model1coefs <- length(model1$coefficients)
	model2coefs <- length(model2$coefficients)	
	model1logliks <- log(fitted(model1))
	model2logliks <- log(fitted(model2))
	correction <- (model1coefs - model2coefs) * (log(numobs) / 2)
	num <- sum(model1logliks) - sum(model2logliks) - correction
	denom <- sd(model1logliks - model2logliks)*sqrt((numobs - 1) / numobs)
	stat <- num / (sqrt(numobs) * denom)
    ans <- list(stat = stat,
                test = "vuong",
                p = 1-2*(1-pnorm(abs(stat)))*(sign(stat) == -1) + (2*(1-pnorm(abs(stat)))-1)*(sign(stat) == 1),   # if p small, model 1 better
                loglik1 = sum(model1logliks),
                loglik2 = sum(model2logliks),
                nparams = c(model1coefs, model2coefs),
                nobs = numobs)
    results <- list(p = ans$p,
                    stat = stat)            
	return(results)
	}


### Table 2
clarke.1.ordered <- manualclarke_clmm(mod.all.val.1.ordered, mod.all.con.1.ordered)                                  
 vuong.1.ordered <- manualvuong_clmm(mod.all.val.1.ordered, mod.all.con.1.ordered) 
clarke.2.ordered <- manualclarke_clmm(mod.all.val.2.ordered, mod.all.con.2.ordered)                                  
 vuong.2.ordered <- manualvuong_clmm(mod.all.val.2.ordered, mod.all.con.2.ordered) 
clarke.3.ordered <- manualclarke_clmm(mod.all.val.3.ordered, mod.all.con.3.ordered)                                  
 vuong.3.ordered <- manualvuong_clmm(mod.all.val.3.ordered, mod.all.con.3.ordered) 
clarke.4.ordered <- manualclarke_clmm(mod.all.val.4.ordered, mod.all.con.4.ordered)                                  
 vuong.4.ordered <- manualvuong_clmm(mod.all.val.4.ordered, mod.all.con.4.ordered) 
clarke.5.ordered <- manualclarke_clmm(mod.all.val.5.ordered, mod.all.con.5.ordered)                                  
 vuong.5.ordered <- manualvuong_clmm(mod.all.val.5.ordered, mod.all.con.5.ordered) 
clarke.1.ordered.rep <- manualclarke_clmm(mod.rep.val.1.ordered, mod.rep.con.1.ordered)                                  
 vuong.1.ordered.rep <- manualvuong_clmm(mod.rep.val.1.ordered, mod.rep.con.1.ordered) 
clarke.2.ordered.rep <- manualclarke_clmm(mod.rep.val.2.ordered, mod.rep.con.2.ordered)                                  
 vuong.2.ordered.rep <- manualvuong_clmm(mod.rep.val.2.ordered, mod.rep.con.2.ordered) 
clarke.3.ordered.rep <- manualclarke_clmm(mod.rep.val.3.ordered, mod.rep.con.3.ordered)                                  
 vuong.3.ordered.rep <- manualvuong_clmm(mod.rep.val.3.ordered, mod.rep.con.3.ordered) 
clarke.4.ordered.rep <- manualclarke_clmm(mod.rep.val.4.ordered, mod.rep.con.4.ordered)                                  
 vuong.4.ordered.rep <- manualvuong_clmm(mod.rep.val.4.ordered, mod.rep.con.4.ordered) 
clarke.5.ordered.rep <- manualclarke_clmm(mod.rep.val.5.ordered, mod.rep.con.5.ordered)                                  
 vuong.5.ordered.rep <- manualvuong_clmm(mod.rep.val.5.ordered, mod.rep.con.5.ordered) 
clarke.1.ordered.sen <- manualclarke_clmm(mod.sen.val.1.ordered, mod.sen.con.1.ordered)                                  
 vuong.1.ordered.sen <- manualvuong_clmm(mod.sen.val.1.ordered, mod.sen.con.1.ordered) 
clarke.2.ordered.sen <- manualclarke_clmm(mod.sen.val.2.ordered, mod.sen.con.2.ordered)                                  
 vuong.2.ordered.sen <- manualvuong_clmm(mod.sen.val.2.ordered, mod.sen.con.2.ordered) 
clarke.3.ordered.sen <- manualclarke_clmm(mod.sen.val.3.ordered, mod.sen.con.3.ordered)                                  
 vuong.3.ordered.sen <- manualvuong_clmm(mod.sen.val.3.ordered, mod.sen.con.3.ordered) 
clarke.4.ordered.sen <- manualclarke_clmm(mod.sen.val.4.ordered, mod.sen.con.4.ordered)                                  
 vuong.4.ordered.sen <- manualvuong_clmm(mod.sen.val.4.ordered, mod.sen.con.4.ordered) 
clarke.5.ordered.sen <- manualclarke_clmm(mod.sen.val.5.ordered, mod.sen.con.5.ordered)                                  
 vuong.5.ordered.sen <- manualvuong_clmm(mod.sen.val.5.ordered, mod.sen.con.5.ordered) 

tests.df <- rbind(data.frame(Legislators = "All",
                             Controls = "None",
                             Test = "Clarke",
                             Statistic = clarke.1.ordered$stat,
                             pvalue = clarke.1.ordered$p),
                  data.frame(Legislators = "All",
                             Controls = "Ideology",
                             Test = "Clarke",
                             Statistic = clarke.2.ordered$stat,
                             pvalue = clarke.2.ordered$p),
                  data.frame(Legislators = "All",
                             Controls = "Ideology & Personality Interaction",
                             Test = "Clarke",
                             Statistic = clarke.3.ordered$stat,
                             pvalue = clarke.3.ordered$p),
                  data.frame(Legislators = "All",
                             Controls = "Ideology, Personality Interaction, and Info.",
                             Test = "Clarke",
                             Statistic = clarke.4.ordered$stat,
                             pvalue = clarke.4.ordered$p),
                  data.frame(Legislators = "All",
                             Controls = "All",
                             Test = "Clarke",
                             Statistic = clarke.5.ordered$stat,
                             pvalue = clarke.5.ordered$p),
                  data.frame(Legislators = "All",
                             Controls = "None",
                             Test = "Vuong",
                             Statistic = vuong.1.ordered$stat,
                             pvalue = vuong.1.ordered$p),
                  data.frame(Legislators = "All",
                             Controls = "Ideology",
                             Test = "Vuong",
                             Statistic = vuong.2.ordered$stat,
                             pvalue = vuong.2.ordered$p),
                  data.frame(Legislators = "All",
                             Controls = "Ideology & Personality Interaction",
                             Test = "Vuong",
                             Statistic = vuong.3.ordered$stat,
                             pvalue = vuong.3.ordered$p),
                  data.frame(Legislators = "All",
                             Controls = "Ideology, Personality Interaction, and Info.",
                             Test = "Vuong",
                             Statistic = vuong.4.ordered$stat,
                             pvalue = vuong.4.ordered$p),
                  data.frame(Legislators = "All",
                             Controls = "All",
                             Test = "Vuong",
                             Statistic = vuong.5.ordered$stat,
                             pvalue = vuong.5.ordered$p),
                  data.frame(Legislators = "Representatives",
                             Controls = "None",
                             Test = "Clarke",
                             Statistic = clarke.1.ordered.rep$stat,
                             pvalue = clarke.1.ordered.rep$p),
                  data.frame(Legislators = "Representatives",
                             Controls = "Ideology",
                             Test = "Clarke",
                             Statistic = clarke.2.ordered.rep$stat,
                             pvalue = clarke.2.ordered.rep$p),
                  data.frame(Legislators = "Representatives",
                             Controls = "Ideology & Personality Interaction",
                             Test = "Clarke",
                             Statistic = clarke.3.ordered.rep$stat,
                             pvalue = clarke.3.ordered.rep$p),
                  data.frame(Legislators = "Representatives",
                             Controls = "Ideology, Personality Interaction, and Info.",
                             Test = "Clarke",
                             Statistic = clarke.4.ordered.rep$stat,
                             pvalue = clarke.4.ordered.rep$p),
                  data.frame(Legislators = "Representatives",
                             Controls = "All",
                             Test = "Clarke",
                             Statistic = clarke.5.ordered.rep$stat,
                             pvalue = clarke.5.ordered.rep$p),
                  data.frame(Legislators = "Representatives",
                             Controls = "None",
                             Test = "Vuong",
                             Statistic = vuong.1.ordered.rep$stat,
                             pvalue = vuong.1.ordered.rep$p),
                  data.frame(Legislators = "Representatives",
                             Controls = "Ideology",
                             Test = "Vuong",
                             Statistic = vuong.2.ordered.rep$stat,
                             pvalue = vuong.2.ordered.rep$p),
                  data.frame(Legislators = "Representatives",
                             Controls = "Ideology & Personality Interaction",
                             Test = "Vuong",
                             Statistic = vuong.3.ordered.rep$stat,
                             pvalue = vuong.3.ordered.rep$p),
                  data.frame(Legislators = "Representatives",
                             Controls = "Ideology, Personality Interaction, and Info.",
                             Test = "Vuong",
                             Statistic = vuong.4.ordered.rep$stat,
                             pvalue = vuong.4.ordered.rep$p),
                  data.frame(Legislators = "Representatives",
                             Controls = "All",
                             Test = "Vuong",
                             Statistic = vuong.5.ordered.rep$stat,
                             pvalue = vuong.5.ordered.rep$p),
                  data.frame(Legislators = "Senators",
                             Controls = "None",
                             Test = "Clarke",
                             Statistic = clarke.1.ordered.sen$stat,
                             pvalue = clarke.1.ordered.sen$p),
                  data.frame(Legislators = "Senators",
                             Controls = "Ideology",
                             Test = "Clarke",
                             Statistic = clarke.2.ordered.sen$stat,
                             pvalue = clarke.2.ordered.sen$p),
                  data.frame(Legislators = "Senators",
                             Controls = "Ideology & Personality Interaction",
                             Test = "Clarke",
                             Statistic = clarke.3.ordered.sen$stat,
                             pvalue = clarke.3.ordered.sen$p),
                  data.frame(Legislators = "Senators",
                             Controls = "Ideology, Personality Interaction, and Info.",
                             Test = "Clarke",
                             Statistic = clarke.4.ordered.sen$stat,
                             pvalue = clarke.4.ordered.sen$p),
                  data.frame(Legislators = "Senators",
                             Controls = "All",
                             Test = "Clarke",
                             Statistic = clarke.5.ordered.sen$stat,
                             pvalue = clarke.5.ordered.sen$p),
                  data.frame(Legislators = "Senators",
                             Controls = "None",
                             Test = "Vuong",
                             Statistic = vuong.1.ordered.sen$stat,
                             pvalue = vuong.1.ordered.sen$p),
                  data.frame(Legislators = "Senators",
                             Controls = "Ideology",
                             Test = "Vuong",
                             Statistic = vuong.2.ordered.sen$stat,
                             pvalue = vuong.2.ordered.sen$p),
                  data.frame(Legislators = "Senators",
                             Controls = "Ideology & Personality Interaction",
                             Test = "Vuong",
                             Statistic = vuong.3.ordered.sen$stat,
                             pvalue = vuong.3.ordered.sen$p),
                  data.frame(Legislators = "Senators",
                             Controls = "Ideology, Personality Interaction, and Info.",
                             Test = "Vuong",
                             Statistic = vuong.4.ordered.sen$stat,
                             pvalue = vuong.4.ordered.sen$p),
                  data.frame(Legislators = "Senators",
                             Controls = "All",
                             Test = "Vuong",
                             Statistic = vuong.5.ordered.sen$stat,
                             pvalue = vuong.5.ordered.sen$p))

print(xtable(digits = 3, tests.df), file = "Table 2.tex")


### Table 4
clarke.relative.1 <- manualclarke_clmm(relative.val.mod.1, relative.con.mod.1)                                  
vuong.relative.1 <- manualvuong_clmm(relative.val.mod.1, relative.con.mod.1) 
clarke.relative.2 <- manualclarke_clmm(relative.val.mod.2, relative.con.mod.2)                                  
vuong.relative.2 <- manualvuong_clmm(relative.val.mod.2, relative.con.mod.2) 
clarke.relative.3 <- manualclarke_clmm(relative.val.mod.3, relative.con.mod.3)                                  
vuong.relative.3 <- manualvuong_clmm(relative.val.mod.3, relative.con.mod.3) 
clarke.relative.4 <- manualclarke_clmm(relative.val.mod.4, relative.con.mod.4)                                  
vuong.relative.4 <- manualvuong_clmm(relative.val.mod.4, relative.con.mod.4) 
clarke.relative.5 <- manualclarke_clmm(relative.val.mod.5, relative.con.mod.5)                                  
vuong.relative.5 <- manualvuong_clmm(relative.val.mod.5, relative.con.mod.5) 


rel.tests.df <- rbind(data.frame(Controls = "None",
                                 Test = "Clarke",
                                 Statistic = clarke.relative.1$stat,
                                 pvalue = clarke.relative.1$p),
                      data.frame(Controls = "Ideology",
                                 Test = "Clarke",
                                 Statistic = clarke.relative.2$stat,
                                 pvalue = clarke.relative.2$p),
                      data.frame(Controls = "Ideology & Personality Interaction",
                                 Test = "Clarke",
                                 Statistic = clarke.relative.3$stat,
                                 pvalue = clarke.relative.3$p),
                      data.frame(Controls = "Ideology, Personality Interaction, and Info.",
                                 Test = "Clarke",
                                 Statistic = clarke.relative.4$stat,
                                 pvalue = clarke.relative.4$p),
                      data.frame(Controls = "All",
                                 Test = "Clarke",
                                 Statistic = clarke.relative.5$stat,
                                 pvalue = clarke.relative.5$p),
                      data.frame(Controls = "None",
                                 Test = "Vuong",
                                 Statistic = vuong.relative.1$stat,
                                 pvalue = vuong.relative.1$p),
                      data.frame(Controls = "Ideology",
                                 Test = "Vuong",
                                 Statistic = vuong.relative.2$stat,
                                 pvalue = vuong.relative.2$p),
                      data.frame(Controls = "Ideology & Personality Interaction",
                                 Test = "Vuong",
                                 Statistic = vuong.relative.3$stat,
                                 pvalue = vuong.relative.3$p),
                      data.frame(Controls = "Ideology, Personality Interaction, and Info.",
                                 Test = "Vuong",
                                 Statistic = vuong.relative.4$stat,
                                 pvalue = vuong.relative.4$p),
                      data.frame(Controls = "All",
                                 Test = "Vuong",
                                 Statistic = vuong.relative.5$stat,
                                 pvalue = vuong.relative.5$p))
      
print(xtable(digits = 3, rel.tests.df), file = "Table 4.tex")


### Table E-10
clarke.1.ordered.copartisan <- manualclarke_clmm(mod.all.val.1.ordered.copartisan, mod.all.con.1.ordered.copartisan)                                  
vuong.1.ordered.copartisan <- manualvuong_clmm(mod.all.val.1.ordered.copartisan, mod.all.con.1.ordered.copartisan) 
clarke.2.ordered.copartisan <- manualclarke_clmm(mod.all.val.2.ordered.copartisan, mod.all.con.2.ordered.copartisan)                                  
vuong.2.ordered.copartisan <- manualvuong_clmm(mod.all.val.2.ordered.copartisan, mod.all.con.2.ordered.copartisan) 
clarke.3.ordered.copartisan <- manualclarke_clmm(mod.all.val.3.ordered.copartisan, mod.all.con.3.ordered.copartisan)                                  
vuong.3.ordered.copartisan <- manualvuong_clmm(mod.all.val.3.ordered.copartisan, mod.all.con.3.ordered.copartisan) 
clarke.4.ordered.copartisan <- manualclarke_clmm(mod.all.val.4.ordered.copartisan, mod.all.con.4.ordered.copartisan)                                  
vuong.4.ordered.copartisan <- manualvuong_clmm(mod.all.val.4.ordered.copartisan, mod.all.con.4.ordered.copartisan) 
clarke.5.ordered.copartisan <- manualclarke_clmm(mod.all.val.5.ordered.copartisan, mod.all.con.5.ordered.copartisan)                                  
vuong.5.ordered.copartisan <- manualvuong_clmm(mod.all.val.5.ordered.copartisan, mod.all.con.5.ordered.copartisan) 
clarke.1.ordered.copartisan.rep <- manualclarke_clmm(mod.rep.val.1.ordered.copartisan, mod.rep.con.1.ordered.copartisan)                                  
vuong.1.ordered.copartisan.rep <- manualvuong_clmm(mod.rep.val.1.ordered.copartisan, mod.rep.con.1.ordered.copartisan) 
clarke.2.ordered.copartisan.rep <- manualclarke_clmm(mod.rep.val.2.ordered.copartisan, mod.rep.con.2.ordered.copartisan)                                  
vuong.2.ordered.copartisan.rep <- manualvuong_clmm(mod.rep.val.2.ordered.copartisan, mod.rep.con.2.ordered.copartisan) 
clarke.3.ordered.copartisan.rep <- manualclarke_clmm(mod.rep.val.3.ordered.copartisan, mod.rep.con.3.ordered.copartisan)                                  
vuong.3.ordered.copartisan.rep <- manualvuong_clmm(mod.rep.val.3.ordered.copartisan, mod.rep.con.3.ordered.copartisan) 
clarke.4.ordered.copartisan.rep <- manualclarke_clmm(mod.rep.val.4.ordered.copartisan, mod.rep.con.4.ordered.copartisan)                                  
vuong.4.ordered.copartisan.rep <- manualvuong_clmm(mod.rep.val.4.ordered.copartisan, mod.rep.con.4.ordered.copartisan) 
clarke.5.ordered.copartisan.rep <- manualclarke_clmm(mod.rep.val.5.ordered.copartisan, mod.rep.con.5.ordered.copartisan)                                  
vuong.5.ordered.copartisan.rep <- manualvuong_clmm(mod.rep.val.5.ordered.copartisan, mod.rep.con.5.ordered.copartisan) 
clarke.1.ordered.copartisan.sen <- manualclarke_clmm(mod.sen.val.1.ordered.copartisan, mod.sen.con.1.ordered.copartisan)                                  
vuong.1.ordered.copartisan.sen <- manualvuong_clmm(mod.sen.val.1.ordered.copartisan, mod.sen.con.1.ordered.copartisan) 
clarke.2.ordered.copartisan.sen <- manualclarke_clmm(mod.sen.val.2.ordered.copartisan, mod.sen.con.2.ordered.copartisan)                                  
vuong.2.ordered.copartisan.sen <- manualvuong_clmm(mod.sen.val.2.ordered.copartisan, mod.sen.con.2.ordered.copartisan) 
clarke.3.ordered.copartisan.sen <- manualclarke_clmm(mod.sen.val.3.ordered.copartisan, mod.sen.con.3.ordered.copartisan)                                  
vuong.3.ordered.copartisan.sen <- manualvuong_clmm(mod.sen.val.3.ordered.copartisan, mod.sen.con.3.ordered.copartisan) 
clarke.4.ordered.copartisan.sen <- manualclarke_clmm(mod.sen.val.4.ordered.copartisan, mod.sen.con.4.ordered.copartisan)                                  
vuong.4.ordered.copartisan.sen <- manualvuong_clmm(mod.sen.val.4.ordered.copartisan, mod.sen.con.4.ordered.copartisan) 
clarke.5.ordered.copartisan.sen <- manualclarke_clmm(mod.sen.val.5.ordered.copartisan, mod.sen.con.5.ordered.copartisan)                                  
vuong.5.ordered.copartisan.sen <- manualvuong_clmm(mod.sen.val.5.ordered.copartisan, mod.sen.con.5.ordered.copartisan) 

tests.copartisan.df <- rbind(data.frame(Legislators = "All",
                             Controls = "None",
                             Test = "Clarke",
                             Statistic = clarke.1.ordered.copartisan$stat,
                             pvalue = clarke.1.ordered.copartisan$p),
                  data.frame(Legislators = "All",
                             Controls = "Ideology",
                             Test = "Clarke",
                             Statistic = clarke.2.ordered.copartisan$stat,
                             pvalue = clarke.2.ordered.copartisan$p),
                  data.frame(Legislators = "All",
                             Controls = "Ideology & Personality Interaction",
                             Test = "Clarke",
                             Statistic = clarke.3.ordered.copartisan$stat,
                             pvalue = clarke.3.ordered.copartisan$p),
                  data.frame(Legislators = "All",
                             Controls = "Ideology, Personality Interaction, and Info.",
                             Test = "Clarke",
                             Statistic = clarke.4.ordered.copartisan$stat,
                             pvalue = clarke.4.ordered.copartisan$p),
                  data.frame(Legislators = "All",
                             Controls = "All",
                             Test = "Clarke",
                             Statistic = clarke.5.ordered.copartisan$stat,
                             pvalue = clarke.5.ordered.copartisan$p),
                  data.frame(Legislators = "All",
                             Controls = "None",
                             Test = "Vuong",
                             Statistic = vuong.1.ordered.copartisan$stat,
                             pvalue = vuong.1.ordered.copartisan$p),
                  data.frame(Legislators = "All",
                             Controls = "Ideology",
                             Test = "Vuong",
                             Statistic = vuong.2.ordered.copartisan$stat,
                             pvalue = vuong.2.ordered.copartisan$p),
                  data.frame(Legislators = "All",
                             Controls = "Ideology & Personality Interaction",
                             Test = "Vuong",
                             Statistic = vuong.3.ordered.copartisan$stat,
                             pvalue = vuong.3.ordered.copartisan$p),
                  data.frame(Legislators = "All",
                             Controls = "Ideology, Personality Interaction, and Info.",
                             Test = "Vuong",
                             Statistic = vuong.4.ordered.copartisan$stat,
                             pvalue = vuong.4.ordered.copartisan$p),
                  data.frame(Legislators = "All",
                             Controls = "All",
                             Test = "Vuong",
                             Statistic = vuong.5.ordered.copartisan$stat,
                             pvalue = vuong.5.ordered.copartisan$p),
                  data.frame(Legislators = "Representatives",
                             Controls = "None",
                             Test = "Clarke",
                             Statistic = clarke.1.ordered.copartisan.rep$stat,
                             pvalue = clarke.1.ordered.copartisan.rep$p),
                  data.frame(Legislators = "Representatives",
                             Controls = "Ideology",
                             Test = "Clarke",
                             Statistic = clarke.2.ordered.copartisan.rep$stat,
                             pvalue = clarke.2.ordered.copartisan.rep$p),
                  data.frame(Legislators = "Representatives",
                             Controls = "Ideology & Personality Interaction",
                             Test = "Clarke",
                             Statistic = clarke.3.ordered.copartisan.rep$stat,
                             pvalue = clarke.3.ordered.copartisan.rep$p),
                  data.frame(Legislators = "Representatives",
                             Controls = "Ideology, Personality Interaction, and Info.",
                             Test = "Clarke",
                             Statistic = clarke.4.ordered.copartisan.rep$stat,
                             pvalue = clarke.4.ordered.copartisan.rep$p),
                  data.frame(Legislators = "Representatives",
                             Controls = "All",
                             Test = "Clarke",
                             Statistic = clarke.5.ordered.copartisan.rep$stat,
                             pvalue = clarke.5.ordered.copartisan.rep$p),
                  data.frame(Legislators = "Representatives",
                             Controls = "None",
                             Test = "Vuong",
                             Statistic = vuong.1.ordered.copartisan.rep$stat,
                             pvalue = vuong.1.ordered.copartisan.rep$p),
                  data.frame(Legislators = "Representatives",
                             Controls = "Ideology",
                             Test = "Vuong",
                             Statistic = vuong.2.ordered.copartisan.rep$stat,
                             pvalue = vuong.2.ordered.copartisan.rep$p),
                  data.frame(Legislators = "Representatives",
                             Controls = "Ideology & Personality Interaction",
                             Test = "Vuong",
                             Statistic = vuong.3.ordered.copartisan.rep$stat,
                             pvalue = vuong.3.ordered.copartisan.rep$p),
                  data.frame(Legislators = "Representatives",
                             Controls = "Ideology, Personality Interaction, and Info.",
                             Test = "Vuong",
                             Statistic = vuong.4.ordered.copartisan.rep$stat,
                             pvalue = vuong.4.ordered.copartisan.rep$p),
                  data.frame(Legislators = "Representatives",
                             Controls = "All",
                             Test = "Vuong",
                             Statistic = vuong.5.ordered.copartisan.rep$stat,
                             pvalue = vuong.5.ordered.copartisan.rep$p),
                  data.frame(Legislators = "Senators",
                             Controls = "None",
                             Test = "Clarke",
                             Statistic = clarke.1.ordered.copartisan.sen$stat,
                             pvalue = clarke.1.ordered.copartisan.sen$p),
                  data.frame(Legislators = "Senators",
                             Controls = "Ideology",
                             Test = "Clarke",
                             Statistic = clarke.2.ordered.copartisan.sen$stat,
                             pvalue = clarke.2.ordered.copartisan.sen$p),
                  data.frame(Legislators = "Senators",
                             Controls = "Ideology & Personality Interaction",
                             Test = "Clarke",
                             Statistic = clarke.3.ordered.copartisan.sen$stat,
                             pvalue = clarke.3.ordered.copartisan.sen$p),
                  data.frame(Legislators = "Senators",
                             Controls = "Ideology, Personality Interaction, and Info.",
                             Test = "Clarke",
                             Statistic = clarke.4.ordered.copartisan.sen$stat,
                             pvalue = clarke.4.ordered.copartisan.sen$p),
                  data.frame(Legislators = "Senators",
                             Controls = "All",
                             Test = "Clarke",
                             Statistic = clarke.5.ordered.copartisan.sen$stat,
                             pvalue = clarke.5.ordered.copartisan.sen$p),
                  data.frame(Legislators = "Senators",
                             Controls = "None",
                             Test = "Vuong",
                             Statistic = vuong.1.ordered.copartisan.sen$stat,
                             pvalue = vuong.1.ordered.copartisan.sen$p),
                  data.frame(Legislators = "Senators",
                             Controls = "Ideology",
                             Test = "Vuong",
                             Statistic = vuong.2.ordered.copartisan.sen$stat,
                             pvalue = vuong.2.ordered.copartisan.sen$p),
                  data.frame(Legislators = "Senators",
                             Controls = "Ideology & Personality Interaction",
                             Test = "Vuong",
                             Statistic = vuong.3.ordered.copartisan.sen$stat,
                             pvalue = vuong.3.ordered.copartisan.sen$p),
                  data.frame(Legislators = "Senators",
                             Controls = "Ideology, Personality Interaction, and Info.",
                             Test = "Vuong",
                             Statistic = vuong.4.ordered.copartisan.sen$stat,
                             pvalue = vuong.4.ordered.copartisan.sen$p),
                  data.frame(Legislators = "Senators",
                             Controls = "All",
                             Test = "Vuong",
                             Statistic = vuong.5.ordered.copartisan.sen$stat,
                             pvalue = vuong.5.ordered.copartisan.sen$p))

print(xtable(digits = 3, tests.copartisan.df), file = "Table E-10.tex")



### Table F-10
clarke.1.ordered.nopartisan <- manualclarke_clmm(mod.all.val.1.ordered.nopartisan, mod.all.con.1.ordered.nopartisan)                                  
vuong.1.ordered.nopartisan <- manualvuong_clmm(mod.all.val.1.ordered.nopartisan, mod.all.con.1.ordered.nopartisan) 
clarke.2.ordered.nopartisan <- manualclarke_clmm(mod.all.val.2.ordered.nopartisan, mod.all.con.2.ordered.nopartisan)                                  
vuong.2.ordered.nopartisan <- manualvuong_clmm(mod.all.val.2.ordered.nopartisan, mod.all.con.2.ordered.nopartisan) 
clarke.3.ordered.nopartisan <- manualclarke_clmm(mod.all.val.3.ordered.nopartisan, mod.all.con.3.ordered.nopartisan)                                  
vuong.3.ordered.nopartisan <- manualvuong_clmm(mod.all.val.3.ordered.nopartisan, mod.all.con.3.ordered.nopartisan) 
clarke.4.ordered.nopartisan <- manualclarke_clmm(mod.all.val.4.ordered.nopartisan, mod.all.con.4.ordered.nopartisan)                                  
vuong.4.ordered.nopartisan <- manualvuong_clmm(mod.all.val.4.ordered.nopartisan, mod.all.con.4.ordered.nopartisan) 
clarke.5.ordered.nopartisan <- manualclarke_clmm(mod.all.val.5.ordered.nopartisan, mod.all.con.5.ordered.nopartisan)                                  
vuong.5.ordered.nopartisan <- manualvuong_clmm(mod.all.val.5.ordered.nopartisan, mod.all.con.5.ordered.nopartisan) 
clarke.1.ordered.nopartisan.rep <- manualclarke_clmm(mod.rep.val.1.ordered.nopartisan, mod.rep.con.1.ordered.nopartisan)                                  
vuong.1.ordered.nopartisan.rep <- manualvuong_clmm(mod.rep.val.1.ordered.nopartisan, mod.rep.con.1.ordered.nopartisan) 
clarke.2.ordered.nopartisan.rep <- manualclarke_clmm(mod.rep.val.2.ordered.nopartisan, mod.rep.con.2.ordered.nopartisan)                                  
vuong.2.ordered.nopartisan.rep <- manualvuong_clmm(mod.rep.val.2.ordered.nopartisan, mod.rep.con.2.ordered.nopartisan) 
clarke.3.ordered.nopartisan.rep <- manualclarke_clmm(mod.rep.val.3.ordered.nopartisan, mod.rep.con.3.ordered.nopartisan)                                  
vuong.3.ordered.nopartisan.rep <- manualvuong_clmm(mod.rep.val.3.ordered.nopartisan, mod.rep.con.3.ordered.nopartisan) 
clarke.4.ordered.nopartisan.rep <- manualclarke_clmm(mod.rep.val.4.ordered.nopartisan, mod.rep.con.4.ordered.nopartisan)                                  
vuong.4.ordered.nopartisan.rep <- manualvuong_clmm(mod.rep.val.4.ordered.nopartisan, mod.rep.con.4.ordered.nopartisan) 
clarke.5.ordered.nopartisan.rep <- manualclarke_clmm(mod.rep.val.5.ordered.nopartisan, mod.rep.con.5.ordered.nopartisan)                                  
vuong.5.ordered.nopartisan.rep <- manualvuong_clmm(mod.rep.val.5.ordered.nopartisan, mod.rep.con.5.ordered.nopartisan) 
clarke.1.ordered.nopartisan.sen <- manualclarke_clmm(mod.sen.val.1.ordered.nopartisan, mod.sen.con.1.ordered.nopartisan)                                  
vuong.1.ordered.nopartisan.sen <- manualvuong_clmm(mod.sen.val.1.ordered.nopartisan, mod.sen.con.1.ordered.nopartisan) 
clarke.2.ordered.nopartisan.sen <- manualclarke_clmm(mod.sen.val.2.ordered.nopartisan, mod.sen.con.2.ordered.nopartisan)                                  
vuong.2.ordered.nopartisan.sen <- manualvuong_clmm(mod.sen.val.2.ordered.nopartisan, mod.sen.con.2.ordered.nopartisan) 
clarke.3.ordered.nopartisan.sen <- manualclarke_clmm(mod.sen.val.3.ordered.nopartisan, mod.sen.con.3.ordered.nopartisan)                                  
vuong.3.ordered.nopartisan.sen <- manualvuong_clmm(mod.sen.val.3.ordered.nopartisan, mod.sen.con.3.ordered.nopartisan) 
clarke.4.ordered.nopartisan.sen <- manualclarke_clmm(mod.sen.val.4.ordered.nopartisan, mod.sen.con.4.ordered.nopartisan)                                  
vuong.4.ordered.nopartisan.sen <- manualvuong_clmm(mod.sen.val.4.ordered.nopartisan, mod.sen.con.4.ordered.nopartisan) 
clarke.5.ordered.nopartisan.sen <- manualclarke_clmm(mod.sen.val.5.ordered.nopartisan, mod.sen.con.5.ordered.nopartisan)                                  
vuong.5.ordered.nopartisan.sen <- manualvuong_clmm(mod.sen.val.5.ordered.nopartisan, mod.sen.con.5.ordered.nopartisan) 

tests.nopartisan.df <- rbind(data.frame(Legislators = "All",
                                        Controls = "None",
                                        Test = "Clarke",
                                        Statistic = clarke.1.ordered.nopartisan$stat,
                                        pvalue = clarke.1.ordered.nopartisan$p),
                             data.frame(Legislators = "All",
                                        Controls = "Ideology",
                                        Test = "Clarke",
                                        Statistic = clarke.2.ordered.nopartisan$stat,
                                        pvalue = clarke.2.ordered.nopartisan$p),
                             data.frame(Legislators = "All",
                                        Controls = "Ideology & Personality Interaction",
                                        Test = "Clarke",
                                        Statistic = clarke.3.ordered.nopartisan$stat,
                                        pvalue = clarke.3.ordered.nopartisan$p),
                             data.frame(Legislators = "All",
                                        Controls = "Ideology, Personality Interaction, and Info.",
                                        Test = "Clarke",
                                        Statistic = clarke.4.ordered.nopartisan$stat,
                                        pvalue = clarke.4.ordered.nopartisan$p),
                             data.frame(Legislators = "All",
                                        Controls = "All",
                                        Test = "Clarke",
                                        Statistic = clarke.5.ordered.nopartisan$stat,
                                        pvalue = clarke.5.ordered.nopartisan$p),
                             data.frame(Legislators = "All",
                                        Controls = "None",
                                        Test = "Vuong",
                                        Statistic = vuong.1.ordered.nopartisan$stat,
                                        pvalue = vuong.1.ordered.nopartisan$p),
                             data.frame(Legislators = "All",
                                        Controls = "Ideology",
                                        Test = "Vuong",
                                        Statistic = vuong.2.ordered.nopartisan$stat,
                                        pvalue = vuong.2.ordered.nopartisan$p),
                             data.frame(Legislators = "All",
                                        Controls = "Ideology & Personality Interaction",
                                        Test = "Vuong",
                                        Statistic = vuong.3.ordered.nopartisan$stat,
                                        pvalue = vuong.3.ordered.nopartisan$p),
                             data.frame(Legislators = "All",
                                        Controls = "Ideology, Personality Interaction, and Info.",
                                        Test = "Vuong",
                                        Statistic = vuong.4.ordered.nopartisan$stat,
                                        pvalue = vuong.4.ordered.nopartisan$p),
                             data.frame(Legislators = "All",
                                        Controls = "All",
                                        Test = "Vuong",
                                        Statistic = vuong.5.ordered.nopartisan$stat,
                                        pvalue = vuong.5.ordered.nopartisan$p),
                             data.frame(Legislators = "Representatives",
                                        Controls = "None",
                                        Test = "Clarke",
                                        Statistic = clarke.1.ordered.nopartisan.rep$stat,
                                        pvalue = clarke.1.ordered.nopartisan.rep$p),
                             data.frame(Legislators = "Representatives",
                                        Controls = "Ideology",
                                        Test = "Clarke",
                                        Statistic = clarke.2.ordered.nopartisan.rep$stat,
                                        pvalue = clarke.2.ordered.nopartisan.rep$p),
                             data.frame(Legislators = "Representatives",
                                        Controls = "Ideology & Personality Interaction",
                                        Test = "Clarke",
                                        Statistic = clarke.3.ordered.nopartisan.rep$stat,
                                        pvalue = clarke.3.ordered.nopartisan.rep$p),
                             data.frame(Legislators = "Representatives",
                                        Controls = "Ideology, Personality Interaction, and Info.",
                                        Test = "Clarke",
                                        Statistic = clarke.4.ordered.nopartisan.rep$stat,
                                        pvalue = clarke.4.ordered.nopartisan.rep$p),
                             data.frame(Legislators = "Representatives",
                                        Controls = "All",
                                        Test = "Clarke",
                                        Statistic = clarke.5.ordered.nopartisan.rep$stat,
                                        pvalue = clarke.5.ordered.nopartisan.rep$p),
                             data.frame(Legislators = "Representatives",
                                        Controls = "None",
                                        Test = "Vuong",
                                        Statistic = vuong.1.ordered.nopartisan.rep$stat,
                                        pvalue = vuong.1.ordered.nopartisan.rep$p),
                             data.frame(Legislators = "Representatives",
                                        Controls = "Ideology",
                                        Test = "Vuong",
                                        Statistic = vuong.2.ordered.nopartisan.rep$stat,
                                        pvalue = vuong.2.ordered.nopartisan.rep$p),
                             data.frame(Legislators = "Representatives",
                                        Controls = "Ideology & Personality Interaction",
                                        Test = "Vuong",
                                        Statistic = vuong.3.ordered.nopartisan.rep$stat,
                                        pvalue = vuong.3.ordered.nopartisan.rep$p),
                             data.frame(Legislators = "Representatives",
                                        Controls = "Ideology, Personality Interaction, and Info.",
                                        Test = "Vuong",
                                        Statistic = vuong.4.ordered.nopartisan.rep$stat,
                                        pvalue = vuong.4.ordered.nopartisan.rep$p),
                             data.frame(Legislators = "Representatives",
                                        Controls = "All",
                                        Test = "Vuong",
                                        Statistic = vuong.5.ordered.nopartisan.rep$stat,
                                        pvalue = vuong.5.ordered.nopartisan.rep$p),
                             data.frame(Legislators = "Senators",
                                        Controls = "None",
                                        Test = "Clarke",
                                        Statistic = clarke.1.ordered.nopartisan.sen$stat,
                                        pvalue = clarke.1.ordered.nopartisan.sen$p),
                             data.frame(Legislators = "Senators",
                                        Controls = "Ideology",
                                        Test = "Clarke",
                                        Statistic = clarke.2.ordered.nopartisan.sen$stat,
                                        pvalue = clarke.2.ordered.nopartisan.sen$p),
                             data.frame(Legislators = "Senators",
                                        Controls = "Ideology & Personality Interaction",
                                        Test = "Clarke",
                                        Statistic = clarke.3.ordered.nopartisan.sen$stat,
                                        pvalue = clarke.3.ordered.nopartisan.sen$p),
                             data.frame(Legislators = "Senators",
                                        Controls = "Ideology, Personality Interaction, and Info.",
                                        Test = "Clarke",
                                        Statistic = clarke.4.ordered.nopartisan.sen$stat,
                                        pvalue = clarke.4.ordered.nopartisan.sen$p),
                             data.frame(Legislators = "Senators",
                                        Controls = "All",
                                        Test = "Clarke",
                                        Statistic = clarke.5.ordered.nopartisan.sen$stat,
                                        pvalue = clarke.5.ordered.nopartisan.sen$p),
                             data.frame(Legislators = "Senators",
                                        Controls = "None",
                                        Test = "Vuong",
                                        Statistic = vuong.1.ordered.nopartisan.sen$stat,
                                        pvalue = vuong.1.ordered.nopartisan.sen$p),
                             data.frame(Legislators = "Senators",
                                        Controls = "Ideology",
                                        Test = "Vuong",
                                        Statistic = vuong.2.ordered.nopartisan.sen$stat,
                                        pvalue = vuong.2.ordered.nopartisan.sen$p),
                             data.frame(Legislators = "Senators",
                                        Controls = "Ideology & Personality Interaction",
                                        Test = "Vuong",
                                        Statistic = vuong.3.ordered.nopartisan.sen$stat,
                                        pvalue = vuong.3.ordered.nopartisan.sen$p),
                             data.frame(Legislators = "Senators",
                                        Controls = "Ideology, Personality Interaction, and Info.",
                                        Test = "Vuong",
                                        Statistic = vuong.4.ordered.nopartisan.sen$stat,
                                        pvalue = vuong.4.ordered.nopartisan.sen$p),
                             data.frame(Legislators = "Senators",
                                        Controls = "All",
                                        Test = "Vuong",
                                        Statistic = vuong.5.ordered.nopartisan.sen$stat,
                                        pvalue = vuong.5.ordered.nopartisan.sen$p))

print(xtable(digits = 3, tests.nopartisan.df), file = "Table F-10.tex")


### Table G-13
clarke.1.ordered.lowinfo <- manualclarke_clmm(mod.all.val.1.ordered.lowinfo, mod.all.con.1.ordered.lowinfo)                                  
vuong.1.ordered.lowinfo <- manualvuong_clmm(mod.all.val.1.ordered.lowinfo, mod.all.con.1.ordered.lowinfo) 
clarke.2.ordered.lowinfo <- manualclarke_clmm(mod.all.val.2.ordered.lowinfo, mod.all.con.2.ordered.lowinfo)                                  
vuong.2.ordered.lowinfo <- manualvuong_clmm(mod.all.val.2.ordered.lowinfo, mod.all.con.2.ordered.lowinfo) 
clarke.3.ordered.lowinfo <- manualclarke_clmm(mod.all.val.3.ordered.lowinfo, mod.all.con.3.ordered.lowinfo)                                  
vuong.3.ordered.lowinfo <- manualvuong_clmm(mod.all.val.3.ordered.lowinfo, mod.all.con.3.ordered.lowinfo) 
clarke.4.ordered.lowinfo <- manualclarke_clmm(mod.all.val.4.ordered.lowinfo, mod.all.con.4.ordered.lowinfo)                                  
vuong.4.ordered.lowinfo <- manualvuong_clmm(mod.all.val.4.ordered.lowinfo, mod.all.con.4.ordered.lowinfo) 
clarke.5.ordered.lowinfo <- manualclarke_clmm(mod.all.val.5.ordered.lowinfo, mod.all.con.5.ordered.lowinfo)                                  
vuong.5.ordered.lowinfo <- manualvuong_clmm(mod.all.val.5.ordered.lowinfo, mod.all.con.5.ordered.lowinfo) 
clarke.1.ordered.lowinfo.rep <- manualclarke_clmm(mod.rep.val.1.ordered.lowinfo, mod.rep.con.1.ordered.lowinfo)                                  
vuong.1.ordered.lowinfo.rep <- manualvuong_clmm(mod.rep.val.1.ordered.lowinfo, mod.rep.con.1.ordered.lowinfo) 
clarke.2.ordered.lowinfo.rep <- manualclarke_clmm(mod.rep.val.2.ordered.lowinfo, mod.rep.con.2.ordered.lowinfo)                                  
vuong.2.ordered.lowinfo.rep <- manualvuong_clmm(mod.rep.val.2.ordered.lowinfo, mod.rep.con.2.ordered.lowinfo) 
clarke.3.ordered.lowinfo.rep <- manualclarke_clmm(mod.rep.val.3.ordered.lowinfo, mod.rep.con.3.ordered.lowinfo)                                  
vuong.3.ordered.lowinfo.rep <- manualvuong_clmm(mod.rep.val.3.ordered.lowinfo, mod.rep.con.3.ordered.lowinfo) 
clarke.4.ordered.lowinfo.rep <- manualclarke_clmm(mod.rep.val.4.ordered.lowinfo, mod.rep.con.4.ordered.lowinfo)                                  
vuong.4.ordered.lowinfo.rep <- manualvuong_clmm(mod.rep.val.4.ordered.lowinfo, mod.rep.con.4.ordered.lowinfo) 
clarke.5.ordered.lowinfo.rep <- manualclarke_clmm(mod.rep.val.5.ordered.lowinfo, mod.rep.con.5.ordered.lowinfo)                                  
vuong.5.ordered.lowinfo.rep <- manualvuong_clmm(mod.rep.val.5.ordered.lowinfo, mod.rep.con.5.ordered.lowinfo) 
clarke.1.ordered.lowinfo.sen <- manualclarke_clmm(mod.sen.val.1.ordered.lowinfo, mod.sen.con.1.ordered.lowinfo)                                  
vuong.1.ordered.lowinfo.sen <- manualvuong_clmm(mod.sen.val.1.ordered.lowinfo, mod.sen.con.1.ordered.lowinfo) 
clarke.2.ordered.lowinfo.sen <- manualclarke_clmm(mod.sen.val.2.ordered.lowinfo, mod.sen.con.2.ordered.lowinfo)                                  
vuong.2.ordered.lowinfo.sen <- manualvuong_clmm(mod.sen.val.2.ordered.lowinfo, mod.sen.con.2.ordered.lowinfo) 
clarke.3.ordered.lowinfo.sen <- manualclarke_clmm(mod.sen.val.3.ordered.lowinfo, mod.sen.con.3.ordered.lowinfo)                                  
vuong.3.ordered.lowinfo.sen <- manualvuong_clmm(mod.sen.val.3.ordered.lowinfo, mod.sen.con.3.ordered.lowinfo) 
clarke.4.ordered.lowinfo.sen <- manualclarke_clmm(mod.sen.val.4.ordered.lowinfo, mod.sen.con.4.ordered.lowinfo)                                  
vuong.4.ordered.lowinfo.sen <- manualvuong_clmm(mod.sen.val.4.ordered.lowinfo, mod.sen.con.4.ordered.lowinfo) 
clarke.5.ordered.lowinfo.sen <- manualclarke_clmm(mod.sen.val.5.ordered.lowinfo, mod.sen.con.5.ordered.lowinfo)                                  
vuong.5.ordered.lowinfo.sen <- manualvuong_clmm(mod.sen.val.5.ordered.lowinfo, mod.sen.con.5.ordered.lowinfo) 

tests.lowinfo.df <- rbind(data.frame(Legislators = "All",
                                        Controls = "None",
                                        Test = "Clarke",
                                        Statistic = clarke.1.ordered.lowinfo$stat,
                                        pvalue = clarke.1.ordered.lowinfo$p),
                             data.frame(Legislators = "All",
                                        Controls = "Ideology",
                                        Test = "Clarke",
                                        Statistic = clarke.2.ordered.lowinfo$stat,
                                        pvalue = clarke.2.ordered.lowinfo$p),
                             data.frame(Legislators = "All",
                                        Controls = "Ideology & Personality Interaction",
                                        Test = "Clarke",
                                        Statistic = clarke.3.ordered.lowinfo$stat,
                                        pvalue = clarke.3.ordered.lowinfo$p),
                             data.frame(Legislators = "All",
                                        Controls = "Ideology, Personality Interaction, and Info.",
                                        Test = "Clarke",
                                        Statistic = clarke.4.ordered.lowinfo$stat,
                                        pvalue = clarke.4.ordered.lowinfo$p),
                             data.frame(Legislators = "All",
                                        Controls = "All",
                                        Test = "Clarke",
                                        Statistic = clarke.5.ordered.lowinfo$stat,
                                        pvalue = clarke.5.ordered.lowinfo$p),
                             data.frame(Legislators = "All",
                                        Controls = "None",
                                        Test = "Vuong",
                                        Statistic = vuong.1.ordered.lowinfo$stat,
                                        pvalue = vuong.1.ordered.lowinfo$p),
                             data.frame(Legislators = "All",
                                        Controls = "Ideology",
                                        Test = "Vuong",
                                        Statistic = vuong.2.ordered.lowinfo$stat,
                                        pvalue = vuong.2.ordered.lowinfo$p),
                             data.frame(Legislators = "All",
                                        Controls = "Ideology & Personality Interaction",
                                        Test = "Vuong",
                                        Statistic = vuong.3.ordered.lowinfo$stat,
                                        pvalue = vuong.3.ordered.lowinfo$p),
                             data.frame(Legislators = "All",
                                        Controls = "Ideology, Personality Interaction, and Info.",
                                        Test = "Vuong",
                                        Statistic = vuong.4.ordered.lowinfo$stat,
                                        pvalue = vuong.4.ordered.lowinfo$p),
                             data.frame(Legislators = "All",
                                        Controls = "All",
                                        Test = "Vuong",
                                        Statistic = vuong.5.ordered.lowinfo$stat,
                                        pvalue = vuong.5.ordered.lowinfo$p),
                             data.frame(Legislators = "Representatives",
                                        Controls = "None",
                                        Test = "Clarke",
                                        Statistic = clarke.1.ordered.lowinfo.rep$stat,
                                        pvalue = clarke.1.ordered.lowinfo.rep$p),
                             data.frame(Legislators = "Representatives",
                                        Controls = "Ideology",
                                        Test = "Clarke",
                                        Statistic = clarke.2.ordered.lowinfo.rep$stat,
                                        pvalue = clarke.2.ordered.lowinfo.rep$p),
                             data.frame(Legislators = "Representatives",
                                        Controls = "Ideology & Personality Interaction",
                                        Test = "Clarke",
                                        Statistic = clarke.3.ordered.lowinfo.rep$stat,
                                        pvalue = clarke.3.ordered.lowinfo.rep$p),
                             data.frame(Legislators = "Representatives",
                                        Controls = "Ideology, Personality Interaction, and Info.",
                                        Test = "Clarke",
                                        Statistic = clarke.4.ordered.lowinfo.rep$stat,
                                        pvalue = clarke.4.ordered.lowinfo.rep$p),
                             data.frame(Legislators = "Representatives",
                                        Controls = "All",
                                        Test = "Clarke",
                                        Statistic = clarke.5.ordered.lowinfo.rep$stat,
                                        pvalue = clarke.5.ordered.lowinfo.rep$p),
                             data.frame(Legislators = "Representatives",
                                        Controls = "None",
                                        Test = "Vuong",
                                        Statistic = vuong.1.ordered.lowinfo.rep$stat,
                                        pvalue = vuong.1.ordered.lowinfo.rep$p),
                             data.frame(Legislators = "Representatives",
                                        Controls = "Ideology",
                                        Test = "Vuong",
                                        Statistic = vuong.2.ordered.lowinfo.rep$stat,
                                        pvalue = vuong.2.ordered.lowinfo.rep$p),
                             data.frame(Legislators = "Representatives",
                                        Controls = "Ideology & Personality Interaction",
                                        Test = "Vuong",
                                        Statistic = vuong.3.ordered.lowinfo.rep$stat,
                                        pvalue = vuong.3.ordered.lowinfo.rep$p),
                             data.frame(Legislators = "Representatives",
                                        Controls = "Ideology, Personality Interaction, and Info.",
                                        Test = "Vuong",
                                        Statistic = vuong.4.ordered.lowinfo.rep$stat,
                                        pvalue = vuong.4.ordered.lowinfo.rep$p),
                             data.frame(Legislators = "Representatives",
                                        Controls = "All",
                                        Test = "Vuong",
                                        Statistic = vuong.5.ordered.lowinfo.rep$stat,
                                        pvalue = vuong.5.ordered.lowinfo.rep$p),
                             data.frame(Legislators = "Senators",
                                        Controls = "None",
                                        Test = "Clarke",
                                        Statistic = clarke.1.ordered.lowinfo.sen$stat,
                                        pvalue = clarke.1.ordered.lowinfo.sen$p),
                             data.frame(Legislators = "Senators",
                                        Controls = "Ideology",
                                        Test = "Clarke",
                                        Statistic = clarke.2.ordered.lowinfo.sen$stat,
                                        pvalue = clarke.2.ordered.lowinfo.sen$p),
                             data.frame(Legislators = "Senators",
                                        Controls = "Ideology & Personality Interaction",
                                        Test = "Clarke",
                                        Statistic = clarke.3.ordered.lowinfo.sen$stat,
                                        pvalue = clarke.3.ordered.lowinfo.sen$p),
                             data.frame(Legislators = "Senators",
                                        Controls = "Ideology, Personality Interaction, and Info.",
                                        Test = "Clarke",
                                        Statistic = clarke.4.ordered.lowinfo.sen$stat,
                                        pvalue = clarke.4.ordered.lowinfo.sen$p),
                             data.frame(Legislators = "Senators",
                                        Controls = "All",
                                        Test = "Clarke",
                                        Statistic = clarke.5.ordered.lowinfo.sen$stat,
                                        pvalue = clarke.5.ordered.lowinfo.sen$p),
                             data.frame(Legislators = "Senators",
                                        Controls = "None",
                                        Test = "Vuong",
                                        Statistic = vuong.1.ordered.lowinfo.sen$stat,
                                        pvalue = vuong.1.ordered.lowinfo.sen$p),
                             data.frame(Legislators = "Senators",
                                        Controls = "Ideology",
                                        Test = "Vuong",
                                        Statistic = vuong.2.ordered.lowinfo.sen$stat,
                                        pvalue = vuong.2.ordered.lowinfo.sen$p),
                             data.frame(Legislators = "Senators",
                                        Controls = "Ideology & Personality Interaction",
                                        Test = "Vuong",
                                        Statistic = vuong.3.ordered.lowinfo.sen$stat,
                                        pvalue = vuong.3.ordered.lowinfo.sen$p),
                             data.frame(Legislators = "Senators",
                                        Controls = "Ideology, Personality Interaction, and Info.",
                                        Test = "Vuong",
                                        Statistic = vuong.4.ordered.lowinfo.sen$stat,
                                        pvalue = vuong.4.ordered.lowinfo.sen$p),
                             data.frame(Legislators = "Senators",
                                        Controls = "All",
                                        Test = "Vuong",
                                        Statistic = vuong.5.ordered.lowinfo.sen$stat,
                                        pvalue = vuong.5.ordered.lowinfo.sen$p))

print(xtable(digits = 3, tests.lowinfo.df), file = "Table G-13.tex")



### Table H-13
clarke.1.ordered.highinfo <- manualclarke_clmm(mod.all.val.1.ordered.highinfo, mod.all.con.1.ordered.highinfo)                                  
vuong.1.ordered.highinfo <- manualvuong_clmm(mod.all.val.1.ordered.highinfo, mod.all.con.1.ordered.highinfo) 
clarke.2.ordered.highinfo <- manualclarke_clmm(mod.all.val.2.ordered.highinfo, mod.all.con.2.ordered.highinfo)                                  
vuong.2.ordered.highinfo <- manualvuong_clmm(mod.all.val.2.ordered.highinfo, mod.all.con.2.ordered.highinfo) 
clarke.3.ordered.highinfo <- manualclarke_clmm(mod.all.val.3.ordered.highinfo, mod.all.con.3.ordered.highinfo)                                  
vuong.3.ordered.highinfo <- manualvuong_clmm(mod.all.val.3.ordered.highinfo, mod.all.con.3.ordered.highinfo) 
clarke.4.ordered.highinfo <- manualclarke_clmm(mod.all.val.4.ordered.highinfo, mod.all.con.4.ordered.highinfo)                                  
vuong.4.ordered.highinfo <- manualvuong_clmm(mod.all.val.4.ordered.highinfo, mod.all.con.4.ordered.highinfo) 
clarke.5.ordered.highinfo <- manualclarke_clmm(mod.all.val.5.ordered.highinfo, mod.all.con.5.ordered.highinfo)                                  
vuong.5.ordered.highinfo <- manualvuong_clmm(mod.all.val.5.ordered.highinfo, mod.all.con.5.ordered.highinfo) 
clarke.1.ordered.highinfo.rep <- manualclarke_clmm(mod.rep.val.1.ordered.highinfo, mod.rep.con.1.ordered.highinfo)                                  
vuong.1.ordered.highinfo.rep <- manualvuong_clmm(mod.rep.val.1.ordered.highinfo, mod.rep.con.1.ordered.highinfo) 
clarke.2.ordered.highinfo.rep <- manualclarke_clmm(mod.rep.val.2.ordered.highinfo, mod.rep.con.2.ordered.highinfo)                                  
vuong.2.ordered.highinfo.rep <- manualvuong_clmm(mod.rep.val.2.ordered.highinfo, mod.rep.con.2.ordered.highinfo) 
clarke.3.ordered.highinfo.rep <- manualclarke_clmm(mod.rep.val.3.ordered.highinfo, mod.rep.con.3.ordered.highinfo)                                  
vuong.3.ordered.highinfo.rep <- manualvuong_clmm(mod.rep.val.3.ordered.highinfo, mod.rep.con.3.ordered.highinfo) 
clarke.4.ordered.highinfo.rep <- manualclarke_clmm(mod.rep.val.4.ordered.highinfo, mod.rep.con.4.ordered.highinfo)                                  
vuong.4.ordered.highinfo.rep <- manualvuong_clmm(mod.rep.val.4.ordered.highinfo, mod.rep.con.4.ordered.highinfo) 
clarke.5.ordered.highinfo.rep <- manualclarke_clmm(mod.rep.val.5.ordered.highinfo, mod.rep.con.5.ordered.highinfo)                                  
vuong.5.ordered.highinfo.rep <- manualvuong_clmm(mod.rep.val.5.ordered.highinfo, mod.rep.con.5.ordered.highinfo) 
clarke.1.ordered.highinfo.sen <- manualclarke_clmm(mod.sen.val.1.ordered.highinfo, mod.sen.con.1.ordered.highinfo)                                  
vuong.1.ordered.highinfo.sen <- manualvuong_clmm(mod.sen.val.1.ordered.highinfo, mod.sen.con.1.ordered.highinfo) 
clarke.2.ordered.highinfo.sen <- manualclarke_clmm(mod.sen.val.2.ordered.highinfo, mod.sen.con.2.ordered.highinfo)                                  
vuong.2.ordered.highinfo.sen <- manualvuong_clmm(mod.sen.val.2.ordered.highinfo, mod.sen.con.2.ordered.highinfo) 
clarke.3.ordered.highinfo.sen <- manualclarke_clmm(mod.sen.val.3.ordered.highinfo, mod.sen.con.3.ordered.highinfo)                                  
vuong.3.ordered.highinfo.sen <- manualvuong_clmm(mod.sen.val.3.ordered.highinfo, mod.sen.con.3.ordered.highinfo) 
clarke.4.ordered.highinfo.sen <- manualclarke_clmm(mod.sen.val.4.ordered.highinfo, mod.sen.con.4.ordered.highinfo)                                  
vuong.4.ordered.highinfo.sen <- manualvuong_clmm(mod.sen.val.4.ordered.highinfo, mod.sen.con.4.ordered.highinfo) 
clarke.5.ordered.highinfo.sen <- manualclarke_clmm(mod.sen.val.5.ordered.highinfo, mod.sen.con.5.ordered.highinfo)                                  
vuong.5.ordered.highinfo.sen <- manualvuong_clmm(mod.sen.val.5.ordered.highinfo, mod.sen.con.5.ordered.highinfo) 

tests.highinfo.df <- rbind(data.frame(Legislators = "All",
                                     Controls = "None",
                                     Test = "Clarke",
                                     Statistic = clarke.1.ordered.highinfo$stat,
                                     pvalue = clarke.1.ordered.highinfo$p),
                          data.frame(Legislators = "All",
                                     Controls = "Ideology",
                                     Test = "Clarke",
                                     Statistic = clarke.2.ordered.highinfo$stat,
                                     pvalue = clarke.2.ordered.highinfo$p),
                          data.frame(Legislators = "All",
                                     Controls = "Ideology & Personality Interaction",
                                     Test = "Clarke",
                                     Statistic = clarke.3.ordered.highinfo$stat,
                                     pvalue = clarke.3.ordered.highinfo$p),
                          data.frame(Legislators = "All",
                                     Controls = "Ideology, Personality Interaction, and Info.",
                                     Test = "Clarke",
                                     Statistic = clarke.4.ordered.highinfo$stat,
                                     pvalue = clarke.4.ordered.highinfo$p),
                          data.frame(Legislators = "All",
                                     Controls = "All",
                                     Test = "Clarke",
                                     Statistic = clarke.5.ordered.highinfo$stat,
                                     pvalue = clarke.5.ordered.highinfo$p),
                          data.frame(Legislators = "All",
                                     Controls = "None",
                                     Test = "Vuong",
                                     Statistic = vuong.1.ordered.highinfo$stat,
                                     pvalue = vuong.1.ordered.highinfo$p),
                          data.frame(Legislators = "All",
                                     Controls = "Ideology",
                                     Test = "Vuong",
                                     Statistic = vuong.2.ordered.highinfo$stat,
                                     pvalue = vuong.2.ordered.highinfo$p),
                          data.frame(Legislators = "All",
                                     Controls = "Ideology & Personality Interaction",
                                     Test = "Vuong",
                                     Statistic = vuong.3.ordered.highinfo$stat,
                                     pvalue = vuong.3.ordered.highinfo$p),
                          data.frame(Legislators = "All",
                                     Controls = "Ideology, Personality Interaction, and Info.",
                                     Test = "Vuong",
                                     Statistic = vuong.4.ordered.highinfo$stat,
                                     pvalue = vuong.4.ordered.highinfo$p),
                          data.frame(Legislators = "All",
                                     Controls = "All",
                                     Test = "Vuong",
                                     Statistic = vuong.5.ordered.highinfo$stat,
                                     pvalue = vuong.5.ordered.highinfo$p),
                          data.frame(Legislators = "Representatives",
                                     Controls = "None",
                                     Test = "Clarke",
                                     Statistic = clarke.1.ordered.highinfo.rep$stat,
                                     pvalue = clarke.1.ordered.highinfo.rep$p),
                          data.frame(Legislators = "Representatives",
                                     Controls = "Ideology",
                                     Test = "Clarke",
                                     Statistic = clarke.2.ordered.highinfo.rep$stat,
                                     pvalue = clarke.2.ordered.highinfo.rep$p),
                          data.frame(Legislators = "Representatives",
                                     Controls = "Ideology & Personality Interaction",
                                     Test = "Clarke",
                                     Statistic = clarke.3.ordered.highinfo.rep$stat,
                                     pvalue = clarke.3.ordered.highinfo.rep$p),
                          data.frame(Legislators = "Representatives",
                                     Controls = "Ideology, Personality Interaction, and Info.",
                                     Test = "Clarke",
                                     Statistic = clarke.4.ordered.highinfo.rep$stat,
                                     pvalue = clarke.4.ordered.highinfo.rep$p),
                          data.frame(Legislators = "Representatives",
                                     Controls = "All",
                                     Test = "Clarke",
                                     Statistic = clarke.5.ordered.highinfo.rep$stat,
                                     pvalue = clarke.5.ordered.highinfo.rep$p),
                          data.frame(Legislators = "Representatives",
                                     Controls = "None",
                                     Test = "Vuong",
                                     Statistic = vuong.1.ordered.highinfo.rep$stat,
                                     pvalue = vuong.1.ordered.highinfo.rep$p),
                          data.frame(Legislators = "Representatives",
                                     Controls = "Ideology",
                                     Test = "Vuong",
                                     Statistic = vuong.2.ordered.highinfo.rep$stat,
                                     pvalue = vuong.2.ordered.highinfo.rep$p),
                          data.frame(Legislators = "Representatives",
                                     Controls = "Ideology & Personality Interaction",
                                     Test = "Vuong",
                                     Statistic = vuong.3.ordered.highinfo.rep$stat,
                                     pvalue = vuong.3.ordered.highinfo.rep$p),
                          data.frame(Legislators = "Representatives",
                                     Controls = "Ideology, Personality Interaction, and Info.",
                                     Test = "Vuong",
                                     Statistic = vuong.4.ordered.highinfo.rep$stat,
                                     pvalue = vuong.4.ordered.highinfo.rep$p),
                          data.frame(Legislators = "Representatives",
                                     Controls = "All",
                                     Test = "Vuong",
                                     Statistic = vuong.5.ordered.highinfo.rep$stat,
                                     pvalue = vuong.5.ordered.highinfo.rep$p),
                          data.frame(Legislators = "Senators",
                                     Controls = "None",
                                     Test = "Clarke",
                                     Statistic = clarke.1.ordered.highinfo.sen$stat,
                                     pvalue = clarke.1.ordered.highinfo.sen$p),
                          data.frame(Legislators = "Senators",
                                     Controls = "Ideology",
                                     Test = "Clarke",
                                     Statistic = clarke.2.ordered.highinfo.sen$stat,
                                     pvalue = clarke.2.ordered.highinfo.sen$p),
                          data.frame(Legislators = "Senators",
                                     Controls = "Ideology & Personality Interaction",
                                     Test = "Clarke",
                                     Statistic = clarke.3.ordered.highinfo.sen$stat,
                                     pvalue = clarke.3.ordered.highinfo.sen$p),
                          data.frame(Legislators = "Senators",
                                     Controls = "Ideology, Personality Interaction, and Info.",
                                     Test = "Clarke",
                                     Statistic = clarke.4.ordered.highinfo.sen$stat,
                                     pvalue = clarke.4.ordered.highinfo.sen$p),
                          data.frame(Legislators = "Senators",
                                     Controls = "All",
                                     Test = "Clarke",
                                     Statistic = clarke.5.ordered.highinfo.sen$stat,
                                     pvalue = clarke.5.ordered.highinfo.sen$p),
                          data.frame(Legislators = "Senators",
                                     Controls = "None",
                                     Test = "Vuong",
                                     Statistic = vuong.1.ordered.highinfo.sen$stat,
                                     pvalue = vuong.1.ordered.highinfo.sen$p),
                          data.frame(Legislators = "Senators",
                                     Controls = "Ideology",
                                     Test = "Vuong",
                                     Statistic = vuong.2.ordered.highinfo.sen$stat,
                                     pvalue = vuong.2.ordered.highinfo.sen$p),
                          data.frame(Legislators = "Senators",
                                     Controls = "Ideology & Personality Interaction",
                                     Test = "Vuong",
                                     Statistic = vuong.3.ordered.highinfo.sen$stat,
                                     pvalue = vuong.3.ordered.highinfo.sen$p),
                          data.frame(Legislators = "Senators",
                                     Controls = "Ideology, Personality Interaction, and Info.",
                                     Test = "Vuong",
                                     Statistic = vuong.4.ordered.highinfo.sen$stat,
                                     pvalue = vuong.4.ordered.highinfo.sen$p),
                          data.frame(Legislators = "Senators",
                                     Controls = "All",
                                     Test = "Vuong",
                                     Statistic = vuong.5.ordered.highinfo.sen$stat,
                                     pvalue = vuong.5.ordered.highinfo.sen$p))

print(xtable(digits = 3, tests.highinfo.df), file = "Table H-13.tex")


### Table C-3
clarke.1.ordered.obama <- manualclarke_clmm(mod.obama.val.1.ordered, mod.obama.con.1.ordered)                                  
vuong.1.ordered.obama <- manualvuong_clmm(mod.obama.val.1.ordered, mod.obama.con.1.ordered) 
clarke.2.ordered.obama <- manualclarke_clmm(mod.obama.val.2.ordered, mod.obama.con.2.ordered)                                  
vuong.2.ordered.obama <- manualvuong_clmm(mod.obama.val.2.ordered, mod.obama.con.2.ordered) 
clarke.3.ordered.obama <- manualclarke_clmm(mod.obama.val.3.ordered, mod.obama.con.3.ordered)                                  
vuong.3.ordered.obama <- manualvuong_clmm(mod.obama.val.3.ordered, mod.obama.con.3.ordered) 
clarke.4.ordered.obama <- manualclarke_clmm(mod.obama.val.4.ordered, mod.obama.con.4.ordered)                                  
vuong.4.ordered.obama <- manualvuong_clmm(mod.obama.val.4.ordered, mod.obama.con.4.ordered) 
clarke.5.ordered.obama <- manualclarke_clmm(mod.obama.val.5.ordered, mod.obama.con.5.ordered)                                  
vuong.5.ordered.obama <- manualvuong_clmm(mod.obama.val.5.ordered, mod.obama.con.5.ordered) 


tests.obama.df <- rbind(data.frame(Controls = "None",
                                      Test = "Clarke",
                                      Statistic = clarke.1.ordered.obama$stat,
                                      pvalue = clarke.1.ordered.obama$p),
                           data.frame(Controls = "Ideology",
                                      Test = "Clarke",
                                      Statistic = clarke.2.ordered.obama$stat,
                                      pvalue = clarke.2.ordered.obama$p),
                           data.frame(Controls = "Ideology & Personality Interaction",
                                      Test = "Clarke",
                                      Statistic = clarke.3.ordered.obama$stat,
                                      pvalue = clarke.3.ordered.obama$p),
                           data.frame(Controls = "Ideology, Personality Interaction, and Info.",
                                      Test = "Clarke",
                                      Statistic = clarke.4.ordered.obama$stat,
                                      pvalue = clarke.4.ordered.obama$p),
                           data.frame(Controls = "All",
                                      Test = "Clarke",
                                      Statistic = clarke.5.ordered.obama$stat,
                                      pvalue = clarke.5.ordered.obama$p),
                           data.frame(Controls = "None",
                                      Test = "Vuong",
                                      Statistic = vuong.1.ordered.obama$stat,
                                      pvalue = vuong.1.ordered.obama$p),
                           data.frame(Controls = "Ideology",
                                      Test = "Vuong",
                                      Statistic = vuong.2.ordered.obama$stat,
                                      pvalue = vuong.2.ordered.obama$p),
                           data.frame(Controls = "Ideology & Personality Interaction",
                                      Test = "Vuong",
                                      Statistic = vuong.3.ordered.obama$stat,
                                      pvalue = vuong.3.ordered.obama$p),
                           data.frame(Controls = "Ideology, Personality Interaction, and Info.",
                                      Test = "Vuong",
                                      Statistic = vuong.4.ordered.obama$stat,
                                      pvalue = vuong.4.ordered.obama$p),
                           data.frame(Controls = "All",
                                      Test = "Vuong",
                                      Statistic = vuong.5.ordered.obama$stat,
                                      pvalue = vuong.5.ordered.obama$p))

print(xtable(digits = 3, tests.obama.df), file = "Table C-3.tex")


### Table D-4
clarke.1.ordered.sen2 <- manualclarke_clmm(mod.sen2.val.1.ordered, mod.sen2.con.1.ordered)                                  
vuong.1.ordered.sen2 <- manualvuong_clmm(mod.sen2.val.1.ordered, mod.sen2.con.1.ordered) 
clarke.2.ordered.sen2 <- manualclarke_clmm(mod.sen2.val.2.ordered, mod.sen2.con.2.ordered)                                  
vuong.2.ordered.sen2 <- manualvuong_clmm(mod.sen2.val.2.ordered, mod.sen2.con.2.ordered) 
clarke.3.ordered.sen2 <- manualclarke_clmm(mod.sen2.val.3.ordered, mod.sen2.con.3.ordered)                                  
vuong.3.ordered.sen2 <- manualvuong_clmm(mod.sen2.val.3.ordered, mod.sen2.con.3.ordered) 
clarke.4.ordered.sen2 <- manualclarke_clmm(mod.sen2.val.4.ordered, mod.sen2.con.4.ordered)                                  
vuong.4.ordered.sen2 <- manualvuong_clmm(mod.sen2.val.4.ordered, mod.sen2.con.4.ordered) 
clarke.5.ordered.sen2 <- manualclarke_clmm(mod.sen2.val.5.ordered, mod.sen2.con.5.ordered)                                  
vuong.5.ordered.sen2 <- manualvuong_clmm(mod.sen2.val.5.ordered, mod.sen2.con.5.ordered) 


tests.sen2.df <- rbind(data.frame(Controls = "None",
                                   Test = "Clarke",
                                   Statistic = clarke.1.ordered.sen2$stat,
                                   pvalue = clarke.1.ordered.sen2$p),
                        data.frame(Controls = "Ideology",
                                   Test = "Clarke",
                                   Statistic = clarke.2.ordered.sen2$stat,
                                   pvalue = clarke.2.ordered.sen2$p),
                        data.frame(Controls = "Ideology & Personality Interaction",
                                   Test = "Clarke",
                                   Statistic = clarke.3.ordered.sen2$stat,
                                   pvalue = clarke.3.ordered.sen2$p),
                        data.frame(Controls = "Ideology, Personality Interaction, and Info.",
                                   Test = "Clarke",
                                   Statistic = clarke.4.ordered.sen2$stat,
                                   pvalue = clarke.4.ordered.sen2$p),
                        data.frame(Controls = "All",
                                   Test = "Clarke",
                                   Statistic = clarke.5.ordered.sen2$stat,
                                   pvalue = clarke.5.ordered.sen2$p),
                        data.frame(Controls = "None",
                                   Test = "Vuong",
                                   Statistic = vuong.1.ordered.sen2$stat,
                                   pvalue = vuong.1.ordered.sen2$p),
                        data.frame(Controls = "Ideology",
                                   Test = "Vuong",
                                   Statistic = vuong.2.ordered.sen2$stat,
                                   pvalue = vuong.2.ordered.sen2$p),
                        data.frame(Controls = "Ideology & Personality Interaction",
                                   Test = "Vuong",
                                   Statistic = vuong.3.ordered.sen2$stat,
                                   pvalue = vuong.3.ordered.sen2$p),
                        data.frame(Controls = "Ideology, Personality Interaction, and Info.",
                                   Test = "Vuong",
                                   Statistic = vuong.4.ordered.sen2$stat,
                                   pvalue = vuong.4.ordered.sen2$p),
                        data.frame(Controls = "All",
                                   Test = "Vuong",
                                   Statistic = vuong.5.ordered.sen2$stat,
                                   pvalue = vuong.5.ordered.sen2$p))

print(xtable(digits = 3, tests.sen2.df), file = "Table D-4.tex")


### Table 3
lmtest.mod.all.1.add.con <- lmtest::lrtest(mod.all.val.1.ordered, mod.all.big.1.ordered)
lmtest.mod.all.1.add.val <- lmtest::lrtest(mod.all.con.1.ordered, mod.all.big.1.ordered)
lmtest.mod.all.2.add.con <- lmtest::lrtest(mod.all.val.2.ordered, mod.all.big.2.ordered)
lmtest.mod.all.2.add.val <- lmtest::lrtest(mod.all.con.2.ordered, mod.all.big.2.ordered)
lmtest.mod.all.3.add.con <- lmtest::lrtest(mod.all.val.3.ordered, mod.all.big.3.ordered)
lmtest.mod.all.3.add.val <- lmtest::lrtest(mod.all.con.3.ordered, mod.all.big.3.ordered)
lmtest.mod.all.4.add.con <- lmtest::lrtest(mod.all.val.4.ordered, mod.all.big.4.ordered)
lmtest.mod.all.4.add.val <- lmtest::lrtest(mod.all.con.4.ordered, mod.all.big.4.ordered)
lmtest.mod.all.5.add.con <- lmtest::lrtest(mod.all.val.5.ordered, mod.all.big.5.ordered)
lmtest.mod.all.5.add.val <- lmtest::lrtest(mod.all.con.5.ordered, mod.all.big.5.ordered)
lmtest.mod.rep.1.add.con <- lmtest::lrtest(mod.rep.val.1.ordered, mod.rep.big.1.ordered)
lmtest.mod.rep.1.add.val <- lmtest::lrtest(mod.rep.con.1.ordered, mod.rep.big.1.ordered)
lmtest.mod.rep.2.add.con <- lmtest::lrtest(mod.rep.val.2.ordered, mod.rep.big.2.ordered)
lmtest.mod.rep.2.add.val <- lmtest::lrtest(mod.rep.con.2.ordered, mod.rep.big.2.ordered)
lmtest.mod.rep.3.add.con <- lmtest::lrtest(mod.rep.val.3.ordered, mod.rep.big.3.ordered)
lmtest.mod.rep.3.add.val <- lmtest::lrtest(mod.rep.con.3.ordered, mod.rep.big.3.ordered)
lmtest.mod.rep.4.add.con <- lmtest::lrtest(mod.rep.val.4.ordered, mod.rep.big.4.ordered)
lmtest.mod.rep.4.add.val <- lmtest::lrtest(mod.rep.con.4.ordered, mod.rep.big.4.ordered)
lmtest.mod.rep.5.add.con <- lmtest::lrtest(mod.rep.val.5.ordered, mod.rep.big.5.ordered)
lmtest.mod.rep.5.add.val <- lmtest::lrtest(mod.rep.con.5.ordered, mod.rep.big.5.ordered)
lmtest.mod.sen.1.add.con <- lmtest::lrtest(mod.sen.val.1.ordered, mod.sen.big.1.ordered)
lmtest.mod.sen.1.add.val <- lmtest::lrtest(mod.sen.con.1.ordered, mod.sen.big.1.ordered)
lmtest.mod.sen.2.add.con <- lmtest::lrtest(mod.sen.val.2.ordered, mod.sen.big.2.ordered)
lmtest.mod.sen.2.add.val <- lmtest::lrtest(mod.sen.con.2.ordered, mod.sen.big.2.ordered)
lmtest.mod.sen.3.add.con <- lmtest::lrtest(mod.sen.val.3.ordered, mod.sen.big.3.ordered)
lmtest.mod.sen.3.add.val <- lmtest::lrtest(mod.sen.con.3.ordered, mod.sen.big.3.ordered)
lmtest.mod.sen.4.add.con <- lmtest::lrtest(mod.sen.val.4.ordered, mod.sen.big.4.ordered)
lmtest.mod.sen.4.add.val <- lmtest::lrtest(mod.sen.con.4.ordered, mod.sen.big.4.ordered)
lmtest.mod.sen.5.add.con <- lmtest::lrtest(mod.sen.val.5.ordered, mod.sen.big.5.ordered)
lmtest.mod.sen.5.add.val <- lmtest::lrtest(mod.sen.con.5.ordered, mod.sen.big.5.ordered)


lmtests.main <- rbind(data.frame(Legislators = "All",
                                 Controls = "None",
                                 Model = "Congruence Added to Valence",
                                 Statistic = lmtest.mod.all.1.add.con$Chisq[2],
                                 pvalue = lmtest.mod.all.1.add.con$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "All",
                                 Controls = "None",
                                 Model = "Valence Added to Congruence",
                                 Statistic = lmtest.mod.all.1.add.val$Chisq[2],
                                 pvalue = lmtest.mod.all.1.add.val$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "All",
                                 Controls = "Ideology",
                                 Model = "Congruence Added to Valence",
                                 Statistic = lmtest.mod.all.2.add.con$Chisq[2],
                                 pvalue = lmtest.mod.all.2.add.con$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "All",
                                 Controls = "Ideology",
                                 Model = "Valence Added to Congruence",
                                 Statistic = lmtest.mod.all.2.add.val$Chisq[2],
                                 pvalue = lmtest.mod.all.2.add.val$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "All",
                                 Controls = "Ideology & Personality Interaction",
                                 Model = "Congruence Added to Valence",
                                 Statistic = lmtest.mod.all.3.add.con$Chisq[2],
                                 pvalue = lmtest.mod.all.3.add.con$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "All",
                                 Controls = "Ideology & Personality Interaction",
                                 Model = "Valence Added to Congruence",
                                 Statistic = lmtest.mod.all.3.add.val$Chisq[2],
                                 pvalue = lmtest.mod.all.3.add.val$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "All",
                                 Controls = "Ideology, Personality Interaction, and Info.",
                                 Model = "Congruence Added to Valence",
                                 Statistic = lmtest.mod.all.4.add.con$Chisq[2],
                                 pvalue = lmtest.mod.all.4.add.con$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "All",
                                 Controls = "Ideology, Personality Interaction, and Info.",
                                 Model = "Valence Added to Congruence",
                                 Statistic = lmtest.mod.all.4.add.val$Chisq[2],
                                 pvalue = lmtest.mod.all.4.add.val$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "All",
                                 Controls = "All",
                                 Model = "Congruence Added to Valence",
                                 Statistic = lmtest.mod.all.5.add.con$Chisq[2],
                                 pvalue = lmtest.mod.all.5.add.con$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "All",
                                 Controls = "All",
                                 Model = "Valence Added to Congruence",
                                 Statistic = lmtest.mod.all.5.add.val$Chisq[2],
                                 pvalue = lmtest.mod.all.5.add.val$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Representatives",
                                 Controls = "None",
                                 Model = "Congruence Added to Valence",
                                 Statistic = lmtest.mod.rep.1.add.con$Chisq[2],
                                 pvalue = lmtest.mod.rep.1.add.con$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Representatives",
                                 Controls = "None",
                                 Model = "Valence Added to Congruence",
                                 Statistic = lmtest.mod.rep.1.add.val$Chisq[2],
                                 pvalue = lmtest.mod.rep.1.add.val$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Representatives",
                                 Controls = "Ideology",
                                 Model = "Congruence Added to Valence",
                                 Statistic = lmtest.mod.rep.2.add.con$Chisq[2],
                                 pvalue = lmtest.mod.rep.2.add.con$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Representatives",
                                 Controls = "Ideology",
                                 Model = "Valence Added to Congruence",
                                 Statistic = lmtest.mod.rep.2.add.val$Chisq[2],
                                 pvalue = lmtest.mod.rep.2.add.val$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Representatives",
                                 Controls = "Ideology & Personality Interaction",
                                 Model = "Congruence Added to Valence",
                                 Statistic = lmtest.mod.rep.3.add.con$Chisq[2],
                                 pvalue = lmtest.mod.rep.3.add.con$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Representatives",
                                 Controls = "Ideology & Personality Interaction",
                                 Model = "Valence Added to Congruence",
                                 Statistic = lmtest.mod.rep.3.add.val$Chisq[2],
                                 pvalue = lmtest.mod.rep.3.add.val$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Representatives",
                                 Controls = "Ideology, Personality Interaction, and Info.",
                                 Model = "Congruence Added to Valence",
                                 Statistic = lmtest.mod.rep.4.add.con$Chisq[2],
                                 pvalue = lmtest.mod.rep.4.add.con$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Representatives",
                                 Controls = "Ideology, Personality Interaction, and Info.",
                                 Model = "Valence Added to Congruence",
                                 Statistic = lmtest.mod.rep.4.add.val$Chisq[2],
                                 pvalue = lmtest.mod.rep.4.add.val$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Representatives",
                                 Controls = "All",
                                 Model = "Congruence Added to Valence",
                                 Statistic = lmtest.mod.rep.5.add.con$Chisq[2],
                                 pvalue = lmtest.mod.rep.5.add.con$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Representatives",
                                 Controls = "All",
                                 Model = "Valence Added to Congruence",
                                 Statistic = lmtest.mod.rep.5.add.val$Chisq[2],
                                 pvalue = lmtest.mod.rep.5.add.val$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Senators",
                                 Controls = "None",
                                 Model = "Congruence Added to Valence",
                                 Statistic = lmtest.mod.sen.1.add.con$Chisq[2],
                                 pvalue = lmtest.mod.sen.1.add.con$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Senators",
                                 Controls = "None",
                                 Model = "Valence Added to Congruence",
                                 Statistic = lmtest.mod.sen.1.add.val$Chisq[2],
                                 pvalue = lmtest.mod.sen.1.add.val$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Senators",
                                 Controls = "Ideology",
                                 Model = "Congruence Added to Valence",
                                 Statistic = lmtest.mod.sen.2.add.con$Chisq[2],
                                 pvalue = lmtest.mod.sen.2.add.con$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Senators",
                                 Controls = "Ideology",
                                 Model = "Valence Added to Congruence",
                                 Statistic = lmtest.mod.sen.2.add.val$Chisq[2],
                                 pvalue = lmtest.mod.sen.2.add.val$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Senators",
                                 Controls = "Ideology & Personality Interaction",
                                 Model = "Congruence Added to Valence",
                                 Statistic = lmtest.mod.sen.3.add.con$Chisq[2],
                                 pvalue = lmtest.mod.sen.3.add.con$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Senators",
                                 Controls = "Ideology & Personality Interaction",
                                 Model = "Valence Added to Congruence",
                                 Statistic = lmtest.mod.sen.3.add.val$Chisq[2],
                                 pvalue = lmtest.mod.sen.3.add.val$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Senators",
                                 Controls = "Ideology, Personality Interaction, and Info.",
                                 Model = "Congruence Added to Valence",
                                 Statistic = lmtest.mod.sen.4.add.con$Chisq[2],
                                 pvalue = lmtest.mod.sen.4.add.con$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Senators",
                                 Controls = "Ideology, Personality Interaction, and Info.",
                                 Model = "Valence Added to Congruence",
                                 Statistic = lmtest.mod.sen.4.add.val$Chisq[2],
                                 pvalue = lmtest.mod.sen.4.add.val$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Senators",
                                 Controls = "All",
                                 Model = "Congruence Added to Valence",
                                 Statistic = lmtest.mod.sen.5.add.con$Chisq[2],
                                 pvalue = lmtest.mod.sen.5.add.con$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Senators",
                                 Controls = "All",
                                 Model = "Valence Added to Congruence",
                                 Statistic = lmtest.mod.sen.5.add.val$Chisq[2],
                                 pvalue = lmtest.mod.sen.5.add.val$`Pr(>Chisq)`[2]))
                      
print(xtable(digits = 3, lmtests.main), file = "Table 3.tex")

                                            
### Table E-11
lmtest.mod.all.1.add.copartisan.con <- lmtest::lrtest(mod.all.val.1.ordered.copartisan, 
                                                      mod.all.big.1.ordered.copartisan)
lmtest.mod.all.1.add.copartisan.val <- lmtest::lrtest(mod.all.con.1.ordered.copartisan, 
                                                      mod.all.big.1.ordered.copartisan)
lmtest.mod.all.2.add.copartisan.con <- lmtest::lrtest(mod.all.val.2.ordered.copartisan, 
                                                      mod.all.big.2.ordered.copartisan)
lmtest.mod.all.2.add.copartisan.val <- lmtest::lrtest(mod.all.con.2.ordered.copartisan, 
                                                      mod.all.big.2.ordered.copartisan)
lmtest.mod.all.3.add.copartisan.con <- lmtest::lrtest(mod.all.val.3.ordered.copartisan, 
                                                      mod.all.big.3.ordered.copartisan)
lmtest.mod.all.3.add.copartisan.val <- lmtest::lrtest(mod.all.con.3.ordered.copartisan, 
                                                      mod.all.big.3.ordered.copartisan)
lmtest.mod.all.4.add.copartisan.con <- lmtest::lrtest(mod.all.val.4.ordered.copartisan, 
                                                      mod.all.big.4.ordered.copartisan)
lmtest.mod.all.4.add.copartisan.val <- lmtest::lrtest(mod.all.con.4.ordered.copartisan, 
                                                      mod.all.big.4.ordered.copartisan)
lmtest.mod.all.5.add.copartisan.con <- lmtest::lrtest(mod.all.val.5.ordered.copartisan, 
                                                      mod.all.big.5.ordered.copartisan)
lmtest.mod.all.5.add.copartisan.val <- lmtest::lrtest(mod.all.con.5.ordered.copartisan, 
                                                      mod.all.big.5.ordered.copartisan)
lmtest.mod.rep.1.add.copartisan.con <- lmtest::lrtest(mod.rep.val.1.ordered.copartisan, 
                                                      mod.rep.big.1.ordered.copartisan)
lmtest.mod.rep.1.add.copartisan.val <- lmtest::lrtest(mod.rep.con.1.ordered.copartisan, 
                                                      mod.rep.big.1.ordered.copartisan)
lmtest.mod.rep.2.add.copartisan.con <- lmtest::lrtest(mod.rep.val.2.ordered.copartisan, 
                                                      mod.rep.big.2.ordered.copartisan)
lmtest.mod.rep.2.add.copartisan.val <- lmtest::lrtest(mod.rep.con.2.ordered.copartisan, 
                                                      mod.rep.big.2.ordered.copartisan)
lmtest.mod.rep.3.add.copartisan.con <- lmtest::lrtest(mod.rep.val.3.ordered.copartisan, 
                                                      mod.rep.big.3.ordered.copartisan)
lmtest.mod.rep.3.add.copartisan.val <- lmtest::lrtest(mod.rep.con.3.ordered.copartisan, 
                                                      mod.rep.big.3.ordered.copartisan)
lmtest.mod.rep.4.add.copartisan.con <- lmtest::lrtest(mod.rep.val.4.ordered.copartisan, 
                                                      mod.rep.big.4.ordered.copartisan)
lmtest.mod.rep.4.add.copartisan.val <- lmtest::lrtest(mod.rep.con.4.ordered.copartisan, 
                                                      mod.rep.big.4.ordered.copartisan)
lmtest.mod.rep.5.add.copartisan.con <- lmtest::lrtest(mod.rep.val.5.ordered.copartisan, 
                                                      mod.rep.big.5.ordered.copartisan)
lmtest.mod.rep.5.add.copartisan.val <- lmtest::lrtest(mod.rep.con.5.ordered.copartisan, 
                                                      mod.rep.big.5.ordered.copartisan)
lmtest.mod.sen.1.add.copartisan.con <- lmtest::lrtest(mod.sen.val.1.ordered.copartisan, 
                                                      mod.sen.big.1.ordered.copartisan)
lmtest.mod.sen.1.add.copartisan.val <- lmtest::lrtest(mod.sen.con.1.ordered.copartisan, 
                                                      mod.sen.big.1.ordered.copartisan)
lmtest.mod.sen.2.add.copartisan.con <- lmtest::lrtest(mod.sen.val.2.ordered.copartisan, 
                                                      mod.sen.big.2.ordered.copartisan)
lmtest.mod.sen.2.add.copartisan.val <- lmtest::lrtest(mod.sen.con.2.ordered.copartisan, 
                                                      mod.sen.big.2.ordered.copartisan)
lmtest.mod.sen.3.add.copartisan.con <- lmtest::lrtest(mod.sen.val.3.ordered.copartisan, 
                                                      mod.sen.big.3.ordered.copartisan)
lmtest.mod.sen.3.add.copartisan.val <- lmtest::lrtest(mod.sen.con.3.ordered.copartisan, 
                                                      mod.sen.big.3.ordered.copartisan)
lmtest.mod.sen.4.add.copartisan.con <- lmtest::lrtest(mod.sen.val.4.ordered.copartisan, 
                                                      mod.sen.big.4.ordered.copartisan)
lmtest.mod.sen.4.add.copartisan.val <- lmtest::lrtest(mod.sen.con.4.ordered.copartisan, 
                                                      mod.sen.big.4.ordered.copartisan)
lmtest.mod.sen.5.add.copartisan.con <- lmtest::lrtest(mod.sen.val.5.ordered.copartisan, 
                                                      mod.sen.big.5.ordered.copartisan)
lmtest.mod.sen.5.add.copartisan.val <- lmtest::lrtest(mod.sen.con.5.ordered.copartisan, 
                                                      mod.sen.big.5.ordered.copartisan)



lmtests.copartisan <- rbind(data.frame(Legislators = "All",
                                 Controls = "None",
                                 Model = "Congruence Added to Valence",
                                 Statistic = lmtest.mod.all.1.add.copartisan.con$Chisq[2],
                                 pvalue = lmtest.mod.all.1.add.copartisan.con$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "All",
                                 Controls = "None",
                                 Model = "Valence Added to Congruence",
                                 Statistic = lmtest.mod.all.1.add.copartisan.val$Chisq[2],
                                 pvalue = lmtest.mod.all.1.add.copartisan.val$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "All",
                                 Controls = "Ideology",
                                 Model = "Congruence Added to Valence",
                                 Statistic = lmtest.mod.all.2.add.copartisan.con$Chisq[2],
                                 pvalue = lmtest.mod.all.2.add.copartisan.con$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "All",
                                 Controls = "Ideology",
                                 Model = "Valence Added to Congruence",
                                 Statistic = lmtest.mod.all.2.add.copartisan.val$Chisq[2],
                                 pvalue = lmtest.mod.all.2.add.copartisan.val$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "All",
                                 Controls = "Ideology & Personality Interaction",
                                 Model = "Congruence Added to Valence",
                                 Statistic = lmtest.mod.all.3.add.copartisan.con$Chisq[2],
                                 pvalue = lmtest.mod.all.3.add.copartisan.con$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "All",
                                 Controls = "Ideology & Personality Interaction",
                                 Model = "Valence Added to Congruence",
                                 Statistic = lmtest.mod.all.3.add.copartisan.val$Chisq[2],
                                 pvalue = lmtest.mod.all.3.add.copartisan.val$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "All",
                                 Controls = "Ideology, Personality Interaction, and Info.",
                                 Model = "Congruence Added to Valence",
                                 Statistic = lmtest.mod.all.4.add.copartisan.con$Chisq[2],
                                 pvalue = lmtest.mod.all.4.add.copartisan.con$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "All",
                                 Controls = "Ideology, Personality Interaction, and Info.",
                                 Model = "Valence Added to Congruence",
                                 Statistic = lmtest.mod.all.4.add.copartisan.val$Chisq[2],
                                 pvalue = lmtest.mod.all.4.add.copartisan.val$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "All",
                                 Controls = "All",
                                 Model = "Congruence Added to Valence",
                                 Statistic = lmtest.mod.all.5.add.copartisan.con$Chisq[2],
                                 pvalue = lmtest.mod.all.5.add.copartisan.con$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "All",
                                 Controls = "All",
                                 Model = "Valence Added to Congruence",
                                 Statistic = lmtest.mod.all.5.add.copartisan.val$Chisq[2],
                                 pvalue = lmtest.mod.all.5.add.copartisan.val$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Representatives",
                                 Controls = "None",
                                 Model = "Congruence Added to Valence",
                                 Statistic = lmtest.mod.rep.1.add.copartisan.con$Chisq[2],
                                 pvalue = lmtest.mod.rep.1.add.copartisan.con$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Representatives",
                                 Controls = "None",
                                 Model = "Valence Added to Congruence",
                                 Statistic = lmtest.mod.rep.1.add.copartisan.val$Chisq[2],
                                 pvalue = lmtest.mod.rep.1.add.copartisan.val$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Representatives",
                                 Controls = "Ideology",
                                 Model = "Congruence Added to Valence",
                                 Statistic = lmtest.mod.rep.2.add.copartisan.con$Chisq[2],
                                 pvalue = lmtest.mod.rep.2.add.copartisan.con$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Representatives",
                                 Controls = "Ideology",
                                 Model = "Valence Added to Congruence",
                                 Statistic = lmtest.mod.rep.2.add.copartisan.val$Chisq[2],
                                 pvalue = lmtest.mod.rep.2.add.copartisan.val$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Representatives",
                                 Controls = "Ideology & Personality Interaction",
                                 Model = "Congruence Added to Valence",
                                 Statistic = lmtest.mod.rep.3.add.copartisan.con$Chisq[2],
                                 pvalue = lmtest.mod.rep.3.add.copartisan.con$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Representatives",
                                 Controls = "Ideology & Personality Interaction",
                                 Model = "Valence Added to Congruence",
                                 Statistic = lmtest.mod.rep.3.add.copartisan.val$Chisq[2],
                                 pvalue = lmtest.mod.rep.3.add.copartisan.val$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Representatives",
                                 Controls = "Ideology, Personality Interaction, and Info.",
                                 Model = "Congruence Added to Valence",
                                 Statistic = lmtest.mod.rep.4.add.copartisan.con$Chisq[2],
                                 pvalue = lmtest.mod.rep.4.add.copartisan.con$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Representatives",
                                 Controls = "Ideology, Personality Interaction, and Info.",
                                 Model = "Valence Added to Congruence",
                                 Statistic = lmtest.mod.rep.4.add.copartisan.val$Chisq[2],
                                 pvalue = lmtest.mod.rep.4.add.copartisan.val$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Representatives",
                                 Controls = "All",
                                 Model = "Congruence Added to Valence",
                                 Statistic = lmtest.mod.rep.5.add.copartisan.con$Chisq[2],
                                 pvalue = lmtest.mod.rep.5.add.copartisan.con$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Representatives",
                                 Controls = "All",
                                 Model = "Valence Added to Congruence",
                                 Statistic = lmtest.mod.rep.5.add.copartisan.val$Chisq[2],
                                 pvalue = lmtest.mod.rep.5.add.copartisan.val$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Senators",
                                 Controls = "None",
                                 Model = "Congruence Added to Valence",
                                 Statistic = lmtest.mod.sen.1.add.copartisan.con$Chisq[2],
                                 pvalue = lmtest.mod.sen.1.add.copartisan.con$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Senators",
                                 Controls = "None",
                                 Model = "Valence Added to Congruence",
                                 Statistic = lmtest.mod.sen.1.add.copartisan.val$Chisq[2],
                                 pvalue = lmtest.mod.sen.1.add.copartisan.val$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Senators",
                                 Controls = "Ideology",
                                 Model = "Congruence Added to Valence",
                                 Statistic = lmtest.mod.sen.2.add.copartisan.con$Chisq[2],
                                 pvalue = lmtest.mod.sen.2.add.copartisan.con$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Senators",
                                 Controls = "Ideology",
                                 Model = "Valence Added to Congruence",
                                 Statistic = lmtest.mod.sen.2.add.copartisan.val$Chisq[2],
                                 pvalue = lmtest.mod.sen.2.add.copartisan.val$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Senators",
                                 Controls = "Ideology & Personality Interaction",
                                 Model = "Congruence Added to Valence",
                                 Statistic = lmtest.mod.sen.3.add.copartisan.con$Chisq[2],
                                 pvalue = lmtest.mod.sen.3.add.copartisan.con$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Senators",
                                 Controls = "Ideology & Personality Interaction",
                                 Model = "Valence Added to Congruence",
                                 Statistic = lmtest.mod.sen.3.add.copartisan.val$Chisq[2],
                                 pvalue = lmtest.mod.sen.3.add.copartisan.val$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Senators",
                                 Controls = "Ideology, Personality Interaction, and Info.",
                                 Model = "Congruence Added to Valence",
                                 Statistic = lmtest.mod.sen.4.add.copartisan.con$Chisq[2],
                                 pvalue = lmtest.mod.sen.4.add.copartisan.con$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Senators",
                                 Controls = "Ideology, Personality Interaction, and Info.",
                                 Model = "Valence Added to Congruence",
                                 Statistic = lmtest.mod.sen.4.add.copartisan.val$Chisq[2],
                                 pvalue = lmtest.mod.sen.4.add.copartisan.val$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Senators",
                                 Controls = "All",
                                 Model = "Congruence Added to Valence",
                                 Statistic = lmtest.mod.sen.5.add.copartisan.con$Chisq[2],
                                 pvalue = lmtest.mod.sen.5.add.copartisan.con$`Pr(>Chisq)`[2]),
                      data.frame(Legislators = "Senators",
                                 Controls = "All",
                                 Model = "Valence Added to Congruence",
                                 Statistic = lmtest.mod.sen.5.add.copartisan.val$Chisq[2],
                                 pvalue = lmtest.mod.sen.5.add.copartisan.val$`Pr(>Chisq)`[2]))

print(xtable(digits = 3, lmtests.copartisan), file = "Table E-11.tex")


### Table F-11
lmtest.mod.all.1.add.nopartisan.con <- lmtest::lrtest(mod.all.val.1.ordered.nopartisan, 
                                                      mod.all.big.1.ordered.nopartisan)
lmtest.mod.all.1.add.nopartisan.val <- lmtest::lrtest(mod.all.con.1.ordered.nopartisan, 
                                                      mod.all.big.1.ordered.nopartisan)
lmtest.mod.all.2.add.nopartisan.con <- lmtest::lrtest(mod.all.val.2.ordered.nopartisan, 
                                                      mod.all.big.2.ordered.nopartisan)
lmtest.mod.all.2.add.nopartisan.val <- lmtest::lrtest(mod.all.con.2.ordered.nopartisan, 
                                                      mod.all.big.2.ordered.nopartisan)
lmtest.mod.all.3.add.nopartisan.con <- lmtest::lrtest(mod.all.val.3.ordered.nopartisan, 
                                                      mod.all.big.3.ordered.nopartisan)
lmtest.mod.all.3.add.nopartisan.val <- lmtest::lrtest(mod.all.con.3.ordered.nopartisan, 
                                                      mod.all.big.3.ordered.nopartisan)
lmtest.mod.all.4.add.nopartisan.con <- lmtest::lrtest(mod.all.val.4.ordered.nopartisan, 
                                                      mod.all.big.4.ordered.nopartisan)
lmtest.mod.all.4.add.nopartisan.val <- lmtest::lrtest(mod.all.con.4.ordered.nopartisan, 
                                                      mod.all.big.4.ordered.nopartisan)
lmtest.mod.all.5.add.nopartisan.con <- lmtest::lrtest(mod.all.val.5.ordered.nopartisan, 
                                                      mod.all.big.5.ordered.nopartisan)
lmtest.mod.all.5.add.nopartisan.val <- lmtest::lrtest(mod.all.con.5.ordered.nopartisan, 
                                                      mod.all.big.5.ordered.nopartisan)
lmtest.mod.rep.1.add.nopartisan.con <- lmtest::lrtest(mod.rep.val.1.ordered.nopartisan, 
                                                      mod.rep.big.1.ordered.nopartisan)
lmtest.mod.rep.1.add.nopartisan.val <- lmtest::lrtest(mod.rep.con.1.ordered.nopartisan, 
                                                      mod.rep.big.1.ordered.nopartisan)
lmtest.mod.rep.2.add.nopartisan.con <- lmtest::lrtest(mod.rep.val.2.ordered.nopartisan, 
                                                      mod.rep.big.2.ordered.nopartisan)
lmtest.mod.rep.2.add.nopartisan.val <- lmtest::lrtest(mod.rep.con.2.ordered.nopartisan, 
                                                      mod.rep.big.2.ordered.nopartisan)
lmtest.mod.rep.3.add.nopartisan.con <- lmtest::lrtest(mod.rep.val.3.ordered.nopartisan, 
                                                      mod.rep.big.3.ordered.nopartisan)
lmtest.mod.rep.3.add.nopartisan.val <- lmtest::lrtest(mod.rep.con.3.ordered.nopartisan, 
                                                      mod.rep.big.3.ordered.nopartisan)
lmtest.mod.rep.4.add.nopartisan.con <- lmtest::lrtest(mod.rep.val.4.ordered.nopartisan, 
                                                      mod.rep.big.4.ordered.nopartisan)
lmtest.mod.rep.4.add.nopartisan.val <- lmtest::lrtest(mod.rep.con.4.ordered.nopartisan, 
                                                      mod.rep.big.4.ordered.nopartisan)
lmtest.mod.rep.5.add.nopartisan.con <- lmtest::lrtest(mod.rep.val.5.ordered.nopartisan, 
                                                      mod.rep.big.5.ordered.nopartisan)
lmtest.mod.rep.5.add.nopartisan.val <- lmtest::lrtest(mod.rep.con.5.ordered.nopartisan, 
                                                      mod.rep.big.5.ordered.nopartisan)
lmtest.mod.sen.1.add.nopartisan.con <- lmtest::lrtest(mod.sen.val.1.ordered.nopartisan, 
                                                      mod.sen.big.1.ordered.nopartisan)
lmtest.mod.sen.1.add.nopartisan.val <- lmtest::lrtest(mod.sen.con.1.ordered.nopartisan, 
                                                      mod.sen.big.1.ordered.nopartisan)
lmtest.mod.sen.2.add.nopartisan.con <- lmtest::lrtest(mod.sen.val.2.ordered.nopartisan, 
                                                      mod.sen.big.2.ordered.nopartisan)
lmtest.mod.sen.2.add.nopartisan.val <- lmtest::lrtest(mod.sen.con.2.ordered.nopartisan, 
                                                      mod.sen.big.2.ordered.nopartisan)
lmtest.mod.sen.3.add.nopartisan.con <- lmtest::lrtest(mod.sen.val.3.ordered.nopartisan, 
                                                      mod.sen.big.3.ordered.nopartisan)
lmtest.mod.sen.3.add.nopartisan.val <- lmtest::lrtest(mod.sen.con.3.ordered.nopartisan, 
                                                      mod.sen.big.3.ordered.nopartisan)
lmtest.mod.sen.4.add.nopartisan.con <- lmtest::lrtest(mod.sen.val.4.ordered.nopartisan, 
                                                      mod.sen.big.4.ordered.nopartisan)
lmtest.mod.sen.4.add.nopartisan.val <- lmtest::lrtest(mod.sen.con.4.ordered.nopartisan, 
                                                      mod.sen.big.4.ordered.nopartisan)
lmtest.mod.sen.5.add.nopartisan.con <- lmtest::lrtest(mod.sen.val.5.ordered.nopartisan, 
                                                      mod.sen.big.5.ordered.nopartisan)
lmtest.mod.sen.5.add.nopartisan.val <- lmtest::lrtest(mod.sen.con.5.ordered.nopartisan, 
                                                      mod.sen.big.5.ordered.nopartisan)



lmtests.nopartisan <- rbind(data.frame(Legislators = "All",
                                       Controls = "None",
                                       Model = "Congruence Added to Valence",
                                       Statistic = lmtest.mod.all.1.add.nopartisan.con$Chisq[2],
                                       pvalue = lmtest.mod.all.1.add.nopartisan.con$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "All",
                                       Controls = "None",
                                       Model = "Valence Added to Congruence",
                                       Statistic = lmtest.mod.all.1.add.nopartisan.val$Chisq[2],
                                       pvalue = lmtest.mod.all.1.add.nopartisan.val$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "All",
                                       Controls = "Ideology",
                                       Model = "Congruence Added to Valence",
                                       Statistic = lmtest.mod.all.2.add.nopartisan.con$Chisq[2],
                                       pvalue = lmtest.mod.all.2.add.nopartisan.con$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "All",
                                       Controls = "Ideology",
                                       Model = "Valence Added to Congruence",
                                       Statistic = lmtest.mod.all.2.add.nopartisan.val$Chisq[2],
                                       pvalue = lmtest.mod.all.2.add.nopartisan.val$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "All",
                                       Controls = "Ideology & Personality Interaction",
                                       Model = "Congruence Added to Valence",
                                       Statistic = lmtest.mod.all.3.add.nopartisan.con$Chisq[2],
                                       pvalue = lmtest.mod.all.3.add.nopartisan.con$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "All",
                                       Controls = "Ideology & Personality Interaction",
                                       Model = "Valence Added to Congruence",
                                       Statistic = lmtest.mod.all.3.add.nopartisan.val$Chisq[2],
                                       pvalue = lmtest.mod.all.3.add.nopartisan.val$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "All",
                                       Controls = "Ideology, Personality Interaction, and Info.",
                                       Model = "Congruence Added to Valence",
                                       Statistic = lmtest.mod.all.4.add.nopartisan.con$Chisq[2],
                                       pvalue = lmtest.mod.all.4.add.nopartisan.con$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "All",
                                       Controls = "Ideology, Personality Interaction, and Info.",
                                       Model = "Valence Added to Congruence",
                                       Statistic = lmtest.mod.all.4.add.nopartisan.val$Chisq[2],
                                       pvalue = lmtest.mod.all.4.add.nopartisan.val$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "All",
                                       Controls = "All",
                                       Model = "Congruence Added to Valence",
                                       Statistic = lmtest.mod.all.5.add.nopartisan.con$Chisq[2],
                                       pvalue = lmtest.mod.all.5.add.nopartisan.con$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "All",
                                       Controls = "All",
                                       Model = "Valence Added to Congruence",
                                       Statistic = lmtest.mod.all.5.add.nopartisan.val$Chisq[2],
                                       pvalue = lmtest.mod.all.5.add.nopartisan.val$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Representatives",
                                       Controls = "None",
                                       Model = "Congruence Added to Valence",
                                       Statistic = lmtest.mod.rep.1.add.nopartisan.con$Chisq[2],
                                       pvalue = lmtest.mod.rep.1.add.nopartisan.con$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Representatives",
                                       Controls = "None",
                                       Model = "Valence Added to Congruence",
                                       Statistic = lmtest.mod.rep.1.add.nopartisan.val$Chisq[2],
                                       pvalue = lmtest.mod.rep.1.add.nopartisan.val$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Representatives",
                                       Controls = "Ideology",
                                       Model = "Congruence Added to Valence",
                                       Statistic = lmtest.mod.rep.2.add.nopartisan.con$Chisq[2],
                                       pvalue = lmtest.mod.rep.2.add.nopartisan.con$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Representatives",
                                       Controls = "Ideology",
                                       Model = "Valence Added to Congruence",
                                       Statistic = lmtest.mod.rep.2.add.nopartisan.val$Chisq[2],
                                       pvalue = lmtest.mod.rep.2.add.nopartisan.val$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Representatives",
                                       Controls = "Ideology & Personality Interaction",
                                       Model = "Congruence Added to Valence",
                                       Statistic = lmtest.mod.rep.3.add.nopartisan.con$Chisq[2],
                                       pvalue = lmtest.mod.rep.3.add.nopartisan.con$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Representatives",
                                       Controls = "Ideology & Personality Interaction",
                                       Model = "Valence Added to Congruence",
                                       Statistic = lmtest.mod.rep.3.add.nopartisan.val$Chisq[2],
                                       pvalue = lmtest.mod.rep.3.add.nopartisan.val$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Representatives",
                                       Controls = "Ideology, Personality Interaction, and Info.",
                                       Model = "Congruence Added to Valence",
                                       Statistic = lmtest.mod.rep.4.add.nopartisan.con$Chisq[2],
                                       pvalue = lmtest.mod.rep.4.add.nopartisan.con$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Representatives",
                                       Controls = "Ideology, Personality Interaction, and Info.",
                                       Model = "Valence Added to Congruence",
                                       Statistic = lmtest.mod.rep.4.add.nopartisan.val$Chisq[2],
                                       pvalue = lmtest.mod.rep.4.add.nopartisan.val$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Representatives",
                                       Controls = "All",
                                       Model = "Congruence Added to Valence",
                                       Statistic = lmtest.mod.rep.5.add.nopartisan.con$Chisq[2],
                                       pvalue = lmtest.mod.rep.5.add.nopartisan.con$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Representatives",
                                       Controls = "All",
                                       Model = "Valence Added to Congruence",
                                       Statistic = lmtest.mod.rep.5.add.nopartisan.val$Chisq[2],
                                       pvalue = lmtest.mod.rep.5.add.nopartisan.val$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Senators",
                                       Controls = "None",
                                       Model = "Congruence Added to Valence",
                                       Statistic = lmtest.mod.sen.1.add.nopartisan.con$Chisq[2],
                                       pvalue = lmtest.mod.sen.1.add.nopartisan.con$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Senators",
                                       Controls = "None",
                                       Model = "Valence Added to Congruence",
                                       Statistic = lmtest.mod.sen.1.add.nopartisan.val$Chisq[2],
                                       pvalue = lmtest.mod.sen.1.add.nopartisan.val$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Senators",
                                       Controls = "Ideology",
                                       Model = "Congruence Added to Valence",
                                       Statistic = lmtest.mod.sen.2.add.nopartisan.con$Chisq[2],
                                       pvalue = lmtest.mod.sen.2.add.nopartisan.con$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Senators",
                                       Controls = "Ideology",
                                       Model = "Valence Added to Congruence",
                                       Statistic = lmtest.mod.sen.2.add.nopartisan.val$Chisq[2],
                                       pvalue = lmtest.mod.sen.2.add.nopartisan.val$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Senators",
                                       Controls = "Ideology & Personality Interaction",
                                       Model = "Congruence Added to Valence",
                                       Statistic = lmtest.mod.sen.3.add.nopartisan.con$Chisq[2],
                                       pvalue = lmtest.mod.sen.3.add.nopartisan.con$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Senators",
                                       Controls = "Ideology & Personality Interaction",
                                       Model = "Valence Added to Congruence",
                                       Statistic = lmtest.mod.sen.3.add.nopartisan.val$Chisq[2],
                                       pvalue = lmtest.mod.sen.3.add.nopartisan.val$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Senators",
                                       Controls = "Ideology, Personality Interaction, and Info.",
                                       Model = "Congruence Added to Valence",
                                       Statistic = lmtest.mod.sen.4.add.nopartisan.con$Chisq[2],
                                       pvalue = lmtest.mod.sen.4.add.nopartisan.con$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Senators",
                                       Controls = "Ideology, Personality Interaction, and Info.",
                                       Model = "Valence Added to Congruence",
                                       Statistic = lmtest.mod.sen.4.add.nopartisan.val$Chisq[2],
                                       pvalue = lmtest.mod.sen.4.add.nopartisan.val$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Senators",
                                       Controls = "All",
                                       Model = "Congruence Added to Valence",
                                       Statistic = lmtest.mod.sen.5.add.nopartisan.con$Chisq[2],
                                       pvalue = lmtest.mod.sen.5.add.nopartisan.con$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Senators",
                                       Controls = "All",
                                       Model = "Valence Added to Congruence",
                                       Statistic = lmtest.mod.sen.5.add.nopartisan.val$Chisq[2],
                                       pvalue = lmtest.mod.sen.5.add.nopartisan.val$`Pr(>Chisq)`[2]))

print(xtable(digits = 3, lmtests.nopartisan), file = "Table F-11.tex")

### Table G-15
lmtest.mod.all.1.add.lowinfo.con <- lmtest::lrtest(mod.all.val.1.ordered.lowinfo, 
                                                      mod.all.big.1.ordered.lowinfo)
lmtest.mod.all.1.add.lowinfo.val <- lmtest::lrtest(mod.all.con.1.ordered.lowinfo, 
                                                      mod.all.big.1.ordered.lowinfo)
lmtest.mod.all.2.add.lowinfo.con <- lmtest::lrtest(mod.all.val.2.ordered.lowinfo, 
                                                      mod.all.big.2.ordered.lowinfo)
lmtest.mod.all.2.add.lowinfo.val <- lmtest::lrtest(mod.all.con.2.ordered.lowinfo, 
                                                      mod.all.big.2.ordered.lowinfo)
lmtest.mod.all.3.add.lowinfo.con <- lmtest::lrtest(mod.all.val.3.ordered.lowinfo, 
                                                      mod.all.big.3.ordered.lowinfo)
lmtest.mod.all.3.add.lowinfo.val <- lmtest::lrtest(mod.all.con.3.ordered.lowinfo, 
                                                      mod.all.big.3.ordered.lowinfo)
lmtest.mod.all.4.add.lowinfo.con <- lmtest::lrtest(mod.all.val.4.ordered.lowinfo, 
                                                      mod.all.big.4.ordered.lowinfo)
lmtest.mod.all.4.add.lowinfo.val <- lmtest::lrtest(mod.all.con.4.ordered.lowinfo, 
                                                      mod.all.big.4.ordered.lowinfo)
lmtest.mod.all.5.add.lowinfo.con <- lmtest::lrtest(mod.all.val.5.ordered.lowinfo, 
                                                      mod.all.big.5.ordered.lowinfo)
lmtest.mod.all.5.add.lowinfo.val <- lmtest::lrtest(mod.all.con.5.ordered.lowinfo, 
                                                      mod.all.big.5.ordered.lowinfo)
lmtest.mod.rep.1.add.lowinfo.con <- lmtest::lrtest(mod.rep.val.1.ordered.lowinfo, 
                                                      mod.rep.big.1.ordered.lowinfo)
lmtest.mod.rep.1.add.lowinfo.val <- lmtest::lrtest(mod.rep.con.1.ordered.lowinfo, 
                                                      mod.rep.big.1.ordered.lowinfo)
lmtest.mod.rep.2.add.lowinfo.con <- lmtest::lrtest(mod.rep.val.2.ordered.lowinfo, 
                                                      mod.rep.big.2.ordered.lowinfo)
lmtest.mod.rep.2.add.lowinfo.val <- lmtest::lrtest(mod.rep.con.2.ordered.lowinfo, 
                                                      mod.rep.big.2.ordered.lowinfo)
lmtest.mod.rep.3.add.lowinfo.con <- lmtest::lrtest(mod.rep.val.3.ordered.lowinfo, 
                                                      mod.rep.big.3.ordered.lowinfo)
lmtest.mod.rep.3.add.lowinfo.val <- lmtest::lrtest(mod.rep.con.3.ordered.lowinfo, 
                                                      mod.rep.big.3.ordered.lowinfo)
lmtest.mod.rep.4.add.lowinfo.con <- lmtest::lrtest(mod.rep.val.4.ordered.lowinfo, 
                                                      mod.rep.big.4.ordered.lowinfo)
lmtest.mod.rep.4.add.lowinfo.val <- lmtest::lrtest(mod.rep.con.4.ordered.lowinfo, 
                                                      mod.rep.big.4.ordered.lowinfo)
lmtest.mod.rep.5.add.lowinfo.con <- lmtest::lrtest(mod.rep.val.5.ordered.lowinfo, 
                                                      mod.rep.big.5.ordered.lowinfo)
lmtest.mod.rep.5.add.lowinfo.val <- lmtest::lrtest(mod.rep.con.5.ordered.lowinfo, 
                                                      mod.rep.big.5.ordered.lowinfo)
lmtest.mod.sen.1.add.lowinfo.con <- lmtest::lrtest(mod.sen.val.1.ordered.lowinfo, 
                                                      mod.sen.big.1.ordered.lowinfo)
lmtest.mod.sen.1.add.lowinfo.val <- lmtest::lrtest(mod.sen.con.1.ordered.lowinfo, 
                                                      mod.sen.big.1.ordered.lowinfo)
lmtest.mod.sen.2.add.lowinfo.con <- lmtest::lrtest(mod.sen.val.2.ordered.lowinfo, 
                                                      mod.sen.big.2.ordered.lowinfo)
lmtest.mod.sen.2.add.lowinfo.val <- lmtest::lrtest(mod.sen.con.2.ordered.lowinfo, 
                                                      mod.sen.big.2.ordered.lowinfo)
lmtest.mod.sen.3.add.lowinfo.con <- lmtest::lrtest(mod.sen.val.3.ordered.lowinfo, 
                                                      mod.sen.big.3.ordered.lowinfo)
lmtest.mod.sen.3.add.lowinfo.val <- lmtest::lrtest(mod.sen.con.3.ordered.lowinfo, 
                                                      mod.sen.big.3.ordered.lowinfo)
lmtest.mod.sen.4.add.lowinfo.con <- lmtest::lrtest(mod.sen.val.4.ordered.lowinfo, 
                                                      mod.sen.big.4.ordered.lowinfo)
lmtest.mod.sen.4.add.lowinfo.val <- lmtest::lrtest(mod.sen.con.4.ordered.lowinfo, 
                                                      mod.sen.big.4.ordered.lowinfo)
lmtest.mod.sen.5.add.lowinfo.con <- lmtest::lrtest(mod.sen.val.5.ordered.lowinfo, 
                                                      mod.sen.big.5.ordered.lowinfo)
lmtest.mod.sen.5.add.lowinfo.val <- lmtest::lrtest(mod.sen.con.5.ordered.lowinfo, 
                                                      mod.sen.big.5.ordered.lowinfo)



lmtests.lowinfo <- rbind(data.frame(Legislators = "All",
                                       Controls = "None",
                                       Model = "Congruence Added to Valence",
                                       Statistic = lmtest.mod.all.1.add.lowinfo.con$Chisq[2],
                                       pvalue = lmtest.mod.all.1.add.lowinfo.con$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "All",
                                       Controls = "None",
                                       Model = "Valence Added to Congruence",
                                       Statistic = lmtest.mod.all.1.add.lowinfo.val$Chisq[2],
                                       pvalue = lmtest.mod.all.1.add.lowinfo.val$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "All",
                                       Controls = "Ideology",
                                       Model = "Congruence Added to Valence",
                                       Statistic = lmtest.mod.all.2.add.lowinfo.con$Chisq[2],
                                       pvalue = lmtest.mod.all.2.add.lowinfo.con$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "All",
                                       Controls = "Ideology",
                                       Model = "Valence Added to Congruence",
                                       Statistic = lmtest.mod.all.2.add.lowinfo.val$Chisq[2],
                                       pvalue = lmtest.mod.all.2.add.lowinfo.val$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "All",
                                       Controls = "Ideology & Personality Interaction",
                                       Model = "Congruence Added to Valence",
                                       Statistic = lmtest.mod.all.3.add.lowinfo.con$Chisq[2],
                                       pvalue = lmtest.mod.all.3.add.lowinfo.con$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "All",
                                       Controls = "Ideology & Personality Interaction",
                                       Model = "Valence Added to Congruence",
                                       Statistic = lmtest.mod.all.3.add.lowinfo.val$Chisq[2],
                                       pvalue = lmtest.mod.all.3.add.lowinfo.val$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "All",
                                       Controls = "Ideology, Personality Interaction, and Info.",
                                       Model = "Congruence Added to Valence",
                                       Statistic = lmtest.mod.all.4.add.lowinfo.con$Chisq[2],
                                       pvalue = lmtest.mod.all.4.add.lowinfo.con$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "All",
                                       Controls = "Ideology, Personality Interaction, and Info.",
                                       Model = "Valence Added to Congruence",
                                       Statistic = lmtest.mod.all.4.add.lowinfo.val$Chisq[2],
                                       pvalue = lmtest.mod.all.4.add.lowinfo.val$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "All",
                                       Controls = "All",
                                       Model = "Congruence Added to Valence",
                                       Statistic = lmtest.mod.all.5.add.lowinfo.con$Chisq[2],
                                       pvalue = lmtest.mod.all.5.add.lowinfo.con$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "All",
                                       Controls = "All",
                                       Model = "Valence Added to Congruence",
                                       Statistic = lmtest.mod.all.5.add.lowinfo.val$Chisq[2],
                                       pvalue = lmtest.mod.all.5.add.lowinfo.val$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Representatives",
                                       Controls = "None",
                                       Model = "Congruence Added to Valence",
                                       Statistic = lmtest.mod.rep.1.add.lowinfo.con$Chisq[2],
                                       pvalue = lmtest.mod.rep.1.add.lowinfo.con$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Representatives",
                                       Controls = "None",
                                       Model = "Valence Added to Congruence",
                                       Statistic = lmtest.mod.rep.1.add.lowinfo.val$Chisq[2],
                                       pvalue = lmtest.mod.rep.1.add.lowinfo.val$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Representatives",
                                       Controls = "Ideology",
                                       Model = "Congruence Added to Valence",
                                       Statistic = lmtest.mod.rep.2.add.lowinfo.con$Chisq[2],
                                       pvalue = lmtest.mod.rep.2.add.lowinfo.con$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Representatives",
                                       Controls = "Ideology",
                                       Model = "Valence Added to Congruence",
                                       Statistic = lmtest.mod.rep.2.add.lowinfo.val$Chisq[2],
                                       pvalue = lmtest.mod.rep.2.add.lowinfo.val$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Representatives",
                                       Controls = "Ideology & Personality Interaction",
                                       Model = "Congruence Added to Valence",
                                       Statistic = lmtest.mod.rep.3.add.lowinfo.con$Chisq[2],
                                       pvalue = lmtest.mod.rep.3.add.lowinfo.con$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Representatives",
                                       Controls = "Ideology & Personality Interaction",
                                       Model = "Valence Added to Congruence",
                                       Statistic = lmtest.mod.rep.3.add.lowinfo.val$Chisq[2],
                                       pvalue = lmtest.mod.rep.3.add.lowinfo.val$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Representatives",
                                       Controls = "Ideology, Personality Interaction, and Info.",
                                       Model = "Congruence Added to Valence",
                                       Statistic = lmtest.mod.rep.4.add.lowinfo.con$Chisq[2],
                                       pvalue = lmtest.mod.rep.4.add.lowinfo.con$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Representatives",
                                       Controls = "Ideology, Personality Interaction, and Info.",
                                       Model = "Valence Added to Congruence",
                                       Statistic = lmtest.mod.rep.4.add.lowinfo.val$Chisq[2],
                                       pvalue = lmtest.mod.rep.4.add.lowinfo.val$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Representatives",
                                       Controls = "All",
                                       Model = "Congruence Added to Valence",
                                       Statistic = lmtest.mod.rep.5.add.lowinfo.con$Chisq[2],
                                       pvalue = lmtest.mod.rep.5.add.lowinfo.con$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Representatives",
                                       Controls = "All",
                                       Model = "Valence Added to Congruence",
                                       Statistic = lmtest.mod.rep.5.add.lowinfo.val$Chisq[2],
                                       pvalue = lmtest.mod.rep.5.add.lowinfo.val$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Senators",
                                       Controls = "None",
                                       Model = "Congruence Added to Valence",
                                       Statistic = lmtest.mod.sen.1.add.lowinfo.con$Chisq[2],
                                       pvalue = lmtest.mod.sen.1.add.lowinfo.con$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Senators",
                                       Controls = "None",
                                       Model = "Valence Added to Congruence",
                                       Statistic = lmtest.mod.sen.1.add.lowinfo.val$Chisq[2],
                                       pvalue = lmtest.mod.sen.1.add.lowinfo.val$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Senators",
                                       Controls = "Ideology",
                                       Model = "Congruence Added to Valence",
                                       Statistic = lmtest.mod.sen.2.add.lowinfo.con$Chisq[2],
                                       pvalue = lmtest.mod.sen.2.add.lowinfo.con$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Senators",
                                       Controls = "Ideology",
                                       Model = "Valence Added to Congruence",
                                       Statistic = lmtest.mod.sen.2.add.lowinfo.val$Chisq[2],
                                       pvalue = lmtest.mod.sen.2.add.lowinfo.val$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Senators",
                                       Controls = "Ideology & Personality Interaction",
                                       Model = "Congruence Added to Valence",
                                       Statistic = lmtest.mod.sen.3.add.lowinfo.con$Chisq[2],
                                       pvalue = lmtest.mod.sen.3.add.lowinfo.con$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Senators",
                                       Controls = "Ideology & Personality Interaction",
                                       Model = "Valence Added to Congruence",
                                       Statistic = lmtest.mod.sen.3.add.lowinfo.val$Chisq[2],
                                       pvalue = lmtest.mod.sen.3.add.lowinfo.val$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Senators",
                                       Controls = "Ideology, Personality Interaction, and Info.",
                                       Model = "Congruence Added to Valence",
                                       Statistic = lmtest.mod.sen.4.add.lowinfo.con$Chisq[2],
                                       pvalue = lmtest.mod.sen.4.add.lowinfo.con$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Senators",
                                       Controls = "Ideology, Personality Interaction, and Info.",
                                       Model = "Valence Added to Congruence",
                                       Statistic = lmtest.mod.sen.4.add.lowinfo.val$Chisq[2],
                                       pvalue = lmtest.mod.sen.4.add.lowinfo.val$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Senators",
                                       Controls = "All",
                                       Model = "Congruence Added to Valence",
                                       Statistic = lmtest.mod.sen.5.add.lowinfo.con$Chisq[2],
                                       pvalue = lmtest.mod.sen.5.add.lowinfo.con$`Pr(>Chisq)`[2]),
                            data.frame(Legislators = "Senators",
                                       Controls = "All",
                                       Model = "Valence Added to Congruence",
                                       Statistic = lmtest.mod.sen.5.add.lowinfo.val$Chisq[2],
                                       pvalue = lmtest.mod.sen.5.add.lowinfo.val$`Pr(>Chisq)`[2]))

print(xtable(digits = 3, lmtests.lowinfo), file = "Table G-15.tex")


### Table H-15
lmtest.mod.all.1.add.highinfo.con <- lmtest::lrtest(mod.all.val.1.ordered.highinfo, 
                                                   mod.all.big.1.ordered.highinfo)
lmtest.mod.all.1.add.highinfo.val <- lmtest::lrtest(mod.all.con.1.ordered.highinfo, 
                                                   mod.all.big.1.ordered.highinfo)
lmtest.mod.all.2.add.highinfo.con <- lmtest::lrtest(mod.all.val.2.ordered.highinfo, 
                                                   mod.all.big.2.ordered.highinfo)
lmtest.mod.all.2.add.highinfo.val <- lmtest::lrtest(mod.all.con.2.ordered.highinfo, 
                                                   mod.all.big.2.ordered.highinfo)
lmtest.mod.all.3.add.highinfo.con <- lmtest::lrtest(mod.all.val.3.ordered.highinfo, 
                                                   mod.all.big.3.ordered.highinfo)
lmtest.mod.all.3.add.highinfo.val <- lmtest::lrtest(mod.all.con.3.ordered.highinfo, 
                                                   mod.all.big.3.ordered.highinfo)
lmtest.mod.all.4.add.highinfo.con <- lmtest::lrtest(mod.all.val.4.ordered.highinfo, 
                                                   mod.all.big.4.ordered.highinfo)
lmtest.mod.all.4.add.highinfo.val <- lmtest::lrtest(mod.all.con.4.ordered.highinfo, 
                                                   mod.all.big.4.ordered.highinfo)
lmtest.mod.all.5.add.highinfo.con <- lmtest::lrtest(mod.all.val.5.ordered.highinfo, 
                                                   mod.all.big.5.ordered.highinfo)
lmtest.mod.all.5.add.highinfo.val <- lmtest::lrtest(mod.all.con.5.ordered.highinfo, 
                                                   mod.all.big.5.ordered.highinfo)
lmtest.mod.rep.1.add.highinfo.con <- lmtest::lrtest(mod.rep.val.1.ordered.highinfo, 
                                                   mod.rep.big.1.ordered.highinfo)
lmtest.mod.rep.1.add.highinfo.val <- lmtest::lrtest(mod.rep.con.1.ordered.highinfo, 
                                                   mod.rep.big.1.ordered.highinfo)
lmtest.mod.rep.2.add.highinfo.con <- lmtest::lrtest(mod.rep.val.2.ordered.highinfo, 
                                                   mod.rep.big.2.ordered.highinfo)
lmtest.mod.rep.2.add.highinfo.val <- lmtest::lrtest(mod.rep.con.2.ordered.highinfo, 
                                                   mod.rep.big.2.ordered.highinfo)
lmtest.mod.rep.3.add.highinfo.con <- lmtest::lrtest(mod.rep.val.3.ordered.highinfo, 
                                                   mod.rep.big.3.ordered.highinfo)
lmtest.mod.rep.3.add.highinfo.val <- lmtest::lrtest(mod.rep.con.3.ordered.highinfo, 
                                                   mod.rep.big.3.ordered.highinfo)
lmtest.mod.rep.4.add.highinfo.con <- lmtest::lrtest(mod.rep.val.4.ordered.highinfo, 
                                                   mod.rep.big.4.ordered.highinfo)
lmtest.mod.rep.4.add.highinfo.val <- lmtest::lrtest(mod.rep.con.4.ordered.highinfo, 
                                                   mod.rep.big.4.ordered.highinfo)
lmtest.mod.rep.5.add.highinfo.con <- lmtest::lrtest(mod.rep.val.5.ordered.highinfo, 
                                                   mod.rep.big.5.ordered.highinfo)
lmtest.mod.rep.5.add.highinfo.val <- lmtest::lrtest(mod.rep.con.5.ordered.highinfo, 
                                                   mod.rep.big.5.ordered.highinfo)
lmtest.mod.sen.1.add.highinfo.con <- lmtest::lrtest(mod.sen.val.1.ordered.highinfo, 
                                                   mod.sen.big.1.ordered.highinfo)
lmtest.mod.sen.1.add.highinfo.val <- lmtest::lrtest(mod.sen.con.1.ordered.highinfo, 
                                                   mod.sen.big.1.ordered.highinfo)
lmtest.mod.sen.2.add.highinfo.con <- lmtest::lrtest(mod.sen.val.2.ordered.highinfo, 
                                                   mod.sen.big.2.ordered.highinfo)
lmtest.mod.sen.2.add.highinfo.val <- lmtest::lrtest(mod.sen.con.2.ordered.highinfo, 
                                                   mod.sen.big.2.ordered.highinfo)
lmtest.mod.sen.3.add.highinfo.con <- lmtest::lrtest(mod.sen.val.3.ordered.highinfo, 
                                                   mod.sen.big.3.ordered.highinfo)
lmtest.mod.sen.3.add.highinfo.val <- lmtest::lrtest(mod.sen.con.3.ordered.highinfo, 
                                                   mod.sen.big.3.ordered.highinfo)
lmtest.mod.sen.4.add.highinfo.con <- lmtest::lrtest(mod.sen.val.4.ordered.highinfo, 
                                                   mod.sen.big.4.ordered.highinfo)
lmtest.mod.sen.4.add.highinfo.val <- lmtest::lrtest(mod.sen.con.4.ordered.highinfo, 
                                                   mod.sen.big.4.ordered.highinfo)
lmtest.mod.sen.5.add.highinfo.con <- lmtest::lrtest(mod.sen.val.5.ordered.highinfo, 
                                                   mod.sen.big.5.ordered.highinfo)
lmtest.mod.sen.5.add.highinfo.val <- lmtest::lrtest(mod.sen.con.5.ordered.highinfo, 
                                                   mod.sen.big.5.ordered.highinfo)



lmtests.highinfo <- rbind(data.frame(Legislators = "All",
                                    Controls = "None",
                                    Model = "Congruence Added to Valence",
                                    Statistic = lmtest.mod.all.1.add.highinfo.con$Chisq[2],
                                    pvalue = lmtest.mod.all.1.add.highinfo.con$`Pr(>Chisq)`[2]),
                         data.frame(Legislators = "All",
                                    Controls = "None",
                                    Model = "Valence Added to Congruence",
                                    Statistic = lmtest.mod.all.1.add.highinfo.val$Chisq[2],
                                    pvalue = lmtest.mod.all.1.add.highinfo.val$`Pr(>Chisq)`[2]),
                         data.frame(Legislators = "All",
                                    Controls = "Ideology",
                                    Model = "Congruence Added to Valence",
                                    Statistic = lmtest.mod.all.2.add.highinfo.con$Chisq[2],
                                    pvalue = lmtest.mod.all.2.add.highinfo.con$`Pr(>Chisq)`[2]),
                         data.frame(Legislators = "All",
                                    Controls = "Ideology",
                                    Model = "Valence Added to Congruence",
                                    Statistic = lmtest.mod.all.2.add.highinfo.val$Chisq[2],
                                    pvalue = lmtest.mod.all.2.add.highinfo.val$`Pr(>Chisq)`[2]),
                         data.frame(Legislators = "All",
                                    Controls = "Ideology & Personality Interaction",
                                    Model = "Congruence Added to Valence",
                                    Statistic = lmtest.mod.all.3.add.highinfo.con$Chisq[2],
                                    pvalue = lmtest.mod.all.3.add.highinfo.con$`Pr(>Chisq)`[2]),
                         data.frame(Legislators = "All",
                                    Controls = "Ideology & Personality Interaction",
                                    Model = "Valence Added to Congruence",
                                    Statistic = lmtest.mod.all.3.add.highinfo.val$Chisq[2],
                                    pvalue = lmtest.mod.all.3.add.highinfo.val$`Pr(>Chisq)`[2]),
                         data.frame(Legislators = "All",
                                    Controls = "Ideology, Personality Interaction, and Info.",
                                    Model = "Congruence Added to Valence",
                                    Statistic = lmtest.mod.all.4.add.highinfo.con$Chisq[2],
                                    pvalue = lmtest.mod.all.4.add.highinfo.con$`Pr(>Chisq)`[2]),
                         data.frame(Legislators = "All",
                                    Controls = "Ideology, Personality Interaction, and Info.",
                                    Model = "Valence Added to Congruence",
                                    Statistic = lmtest.mod.all.4.add.highinfo.val$Chisq[2],
                                    pvalue = lmtest.mod.all.4.add.highinfo.val$`Pr(>Chisq)`[2]),
                         data.frame(Legislators = "All",
                                    Controls = "All",
                                    Model = "Congruence Added to Valence",
                                    Statistic = lmtest.mod.all.5.add.highinfo.con$Chisq[2],
                                    pvalue = lmtest.mod.all.5.add.highinfo.con$`Pr(>Chisq)`[2]),
                         data.frame(Legislators = "All",
                                    Controls = "All",
                                    Model = "Valence Added to Congruence",
                                    Statistic = lmtest.mod.all.5.add.highinfo.val$Chisq[2],
                                    pvalue = lmtest.mod.all.5.add.highinfo.val$`Pr(>Chisq)`[2]),
                         data.frame(Legislators = "Representatives",
                                    Controls = "None",
                                    Model = "Congruence Added to Valence",
                                    Statistic = lmtest.mod.rep.1.add.highinfo.con$Chisq[2],
                                    pvalue = lmtest.mod.rep.1.add.highinfo.con$`Pr(>Chisq)`[2]),
                         data.frame(Legislators = "Representatives",
                                    Controls = "None",
                                    Model = "Valence Added to Congruence",
                                    Statistic = lmtest.mod.rep.1.add.highinfo.val$Chisq[2],
                                    pvalue = lmtest.mod.rep.1.add.highinfo.val$`Pr(>Chisq)`[2]),
                         data.frame(Legislators = "Representatives",
                                    Controls = "Ideology",
                                    Model = "Congruence Added to Valence",
                                    Statistic = lmtest.mod.rep.2.add.highinfo.con$Chisq[2],
                                    pvalue = lmtest.mod.rep.2.add.highinfo.con$`Pr(>Chisq)`[2]),
                         data.frame(Legislators = "Representatives",
                                    Controls = "Ideology",
                                    Model = "Valence Added to Congruence",
                                    Statistic = lmtest.mod.rep.2.add.highinfo.val$Chisq[2],
                                    pvalue = lmtest.mod.rep.2.add.highinfo.val$`Pr(>Chisq)`[2]),
                         data.frame(Legislators = "Representatives",
                                    Controls = "Ideology & Personality Interaction",
                                    Model = "Congruence Added to Valence",
                                    Statistic = lmtest.mod.rep.3.add.highinfo.con$Chisq[2],
                                    pvalue = lmtest.mod.rep.3.add.highinfo.con$`Pr(>Chisq)`[2]),
                         data.frame(Legislators = "Representatives",
                                    Controls = "Ideology & Personality Interaction",
                                    Model = "Valence Added to Congruence",
                                    Statistic = lmtest.mod.rep.3.add.highinfo.val$Chisq[2],
                                    pvalue = lmtest.mod.rep.3.add.highinfo.val$`Pr(>Chisq)`[2]),
                         data.frame(Legislators = "Representatives",
                                    Controls = "Ideology, Personality Interaction, and Info.",
                                    Model = "Congruence Added to Valence",
                                    Statistic = lmtest.mod.rep.4.add.highinfo.con$Chisq[2],
                                    pvalue = lmtest.mod.rep.4.add.highinfo.con$`Pr(>Chisq)`[2]),
                         data.frame(Legislators = "Representatives",
                                    Controls = "Ideology, Personality Interaction, and Info.",
                                    Model = "Valence Added to Congruence",
                                    Statistic = lmtest.mod.rep.4.add.highinfo.val$Chisq[2],
                                    pvalue = lmtest.mod.rep.4.add.highinfo.val$`Pr(>Chisq)`[2]),
                         data.frame(Legislators = "Representatives",
                                    Controls = "All",
                                    Model = "Congruence Added to Valence",
                                    Statistic = lmtest.mod.rep.5.add.highinfo.con$Chisq[2],
                                    pvalue = lmtest.mod.rep.5.add.highinfo.con$`Pr(>Chisq)`[2]),
                         data.frame(Legislators = "Representatives",
                                    Controls = "All",
                                    Model = "Valence Added to Congruence",
                                    Statistic = lmtest.mod.rep.5.add.highinfo.val$Chisq[2],
                                    pvalue = lmtest.mod.rep.5.add.highinfo.val$`Pr(>Chisq)`[2]),
                         data.frame(Legislators = "Senators",
                                    Controls = "None",
                                    Model = "Congruence Added to Valence",
                                    Statistic = lmtest.mod.sen.1.add.highinfo.con$Chisq[2],
                                    pvalue = lmtest.mod.sen.1.add.highinfo.con$`Pr(>Chisq)`[2]),
                         data.frame(Legislators = "Senators",
                                    Controls = "None",
                                    Model = "Valence Added to Congruence",
                                    Statistic = lmtest.mod.sen.1.add.highinfo.val$Chisq[2],
                                    pvalue = lmtest.mod.sen.1.add.highinfo.val$`Pr(>Chisq)`[2]),
                         data.frame(Legislators = "Senators",
                                    Controls = "Ideology",
                                    Model = "Congruence Added to Valence",
                                    Statistic = lmtest.mod.sen.2.add.highinfo.con$Chisq[2],
                                    pvalue = lmtest.mod.sen.2.add.highinfo.con$`Pr(>Chisq)`[2]),
                         data.frame(Legislators = "Senators",
                                    Controls = "Ideology",
                                    Model = "Valence Added to Congruence",
                                    Statistic = lmtest.mod.sen.2.add.highinfo.val$Chisq[2],
                                    pvalue = lmtest.mod.sen.2.add.highinfo.val$`Pr(>Chisq)`[2]),
                         data.frame(Legislators = "Senators",
                                    Controls = "Ideology & Personality Interaction",
                                    Model = "Congruence Added to Valence",
                                    Statistic = lmtest.mod.sen.3.add.highinfo.con$Chisq[2],
                                    pvalue = lmtest.mod.sen.3.add.highinfo.con$`Pr(>Chisq)`[2]),
                         data.frame(Legislators = "Senators",
                                    Controls = "Ideology & Personality Interaction",
                                    Model = "Valence Added to Congruence",
                                    Statistic = lmtest.mod.sen.3.add.highinfo.val$Chisq[2],
                                    pvalue = lmtest.mod.sen.3.add.highinfo.val$`Pr(>Chisq)`[2]),
                         data.frame(Legislators = "Senators",
                                    Controls = "Ideology, Personality Interaction, and Info.",
                                    Model = "Congruence Added to Valence",
                                    Statistic = lmtest.mod.sen.4.add.highinfo.con$Chisq[2],
                                    pvalue = lmtest.mod.sen.4.add.highinfo.con$`Pr(>Chisq)`[2]),
                         data.frame(Legislators = "Senators",
                                    Controls = "Ideology, Personality Interaction, and Info.",
                                    Model = "Valence Added to Congruence",
                                    Statistic = lmtest.mod.sen.4.add.highinfo.val$Chisq[2],
                                    pvalue = lmtest.mod.sen.4.add.highinfo.val$`Pr(>Chisq)`[2]),
                         data.frame(Legislators = "Senators",
                                    Controls = "All",
                                    Model = "Congruence Added to Valence",
                                    Statistic = lmtest.mod.sen.5.add.highinfo.con$Chisq[2],
                                    pvalue = lmtest.mod.sen.5.add.highinfo.con$`Pr(>Chisq)`[2]),
                         data.frame(Legislators = "Senators",
                                    Controls = "All",
                                    Model = "Valence Added to Congruence",
                                    Statistic = lmtest.mod.sen.5.add.highinfo.val$Chisq[2],
                                    pvalue = lmtest.mod.sen.5.add.highinfo.val$`Pr(>Chisq)`[2]))

print(xtable(digits = 3, lmtests.highinfo), file = "Table H-15.tex")


### Table C-5
lmtest.mod.obama.1.add.con <- lmtest::lrtest(mod.obama.val.1.ordered, mod.obama.big.1.ordered)
lmtest.mod.obama.1.add.val <- lmtest::lrtest(mod.obama.con.1.ordered, mod.obama.big.1.ordered)
lmtest.mod.obama.2.add.con <- lmtest::lrtest(mod.obama.val.2.ordered, mod.obama.big.2.ordered)
lmtest.mod.obama.2.add.val <- lmtest::lrtest(mod.obama.con.2.ordered, mod.obama.big.2.ordered)
lmtest.mod.obama.3.add.con <- lmtest::lrtest(mod.obama.val.3.ordered, mod.obama.big.3.ordered)
lmtest.mod.obama.3.add.val <- lmtest::lrtest(mod.obama.con.3.ordered, mod.obama.big.3.ordered)
lmtest.mod.obama.4.add.con <- lmtest::lrtest(mod.obama.val.4.ordered, mod.obama.big.4.ordered)
lmtest.mod.obama.4.add.val <- lmtest::lrtest(mod.obama.con.4.ordered, mod.obama.big.4.ordered)
lmtest.mod.obama.5.add.con <- lmtest::lrtest(mod.obama.val.5.ordered, mod.obama.big.5.ordered)
lmtest.mod.obama.5.add.val <- lmtest::lrtest(mod.obama.con.5.ordered, mod.obama.big.5.ordered)

lmtests.obama <- rbind(data.frame(Controls = "None",
                                  Model = "Congruence Added to Valence",
                                  Statistic = lmtest.mod.obama.1.add.con$Chisq[2],
                                  pvalue = lmtest.mod.obama.1.add.con$`Pr(>Chisq)`[2]),
                       data.frame(Controls = "None",
                                  Model = "Valence Added to Congruence",
                                  Statistic = lmtest.mod.obama.1.add.val$Chisq[2],
                                  pvalue = lmtest.mod.obama.1.add.val$`Pr(>Chisq)`[2]),
                       data.frame(Controls = "Ideology",
                                  Model = "Congruence Added to Valence",
                                  Statistic = lmtest.mod.obama.2.add.con$Chisq[2],
                                  pvalue = lmtest.mod.obama.2.add.con$`Pr(>Chisq)`[2]),
                       data.frame(Controls = "Ideology",
                                  Model = "Valence Added to Congruence",
                                  Statistic = lmtest.mod.obama.2.add.val$Chisq[2],
                                  pvalue = lmtest.mod.obama.2.add.val$`Pr(>Chisq)`[2]),
                       data.frame(Controls = "Ideology & Personality Interaction",
                                  Model = "Congruence Added to Valence",
                                  Statistic = lmtest.mod.obama.3.add.con$Chisq[2],
                                  pvalue = lmtest.mod.obama.3.add.con$`Pr(>Chisq)`[2]),
                       data.frame(Controls = "Ideology & Personality Interaction",
                                  Model = "Valence Added to Congruence",
                                  Statistic = lmtest.mod.obama.3.add.val$Chisq[2],
                                  pvalue = lmtest.mod.obama.3.add.val$`Pr(>Chisq)`[2]),
                       data.frame(Controls = "Ideology, Personality Interaction, and Info.",
                                  Model = "Congruence Added to Valence",
                                  Statistic = lmtest.mod.obama.4.add.con$Chisq[2],
                                  pvalue = lmtest.mod.obama.4.add.con$`Pr(>Chisq)`[2]),
                       data.frame(Controls = "Ideology, Personality Interaction, and Info.",
                                  Model = "Valence Added to Congruence",
                                  Statistic = lmtest.mod.obama.4.add.val$Chisq[2],
                                  pvalue = lmtest.mod.obama.4.add.val$`Pr(>Chisq)`[2]),
                       data.frame(Controls = "All",
                                  Model = "Congruence Added to Valence",
                                  Statistic = lmtest.mod.obama.5.add.con$Chisq[2],
                                  pvalue = lmtest.mod.obama.5.add.con$`Pr(>Chisq)`[2]),
                       data.frame(Controls = "All",
                                  Model = "Valence Added to Congruence",
                                  Statistic = lmtest.mod.obama.5.add.val$Chisq[2],
                                  pvalue = lmtest.mod.obama.5.add.val$`Pr(>Chisq)`[2]))

print(xtable(digits = 3, lmtests.obama), file = "Table C-5.tex")


### Table D-5
lmtest.mod.sen2.1.add.con <- lmtest::lrtest(mod.sen2.val.1.ordered, mod.sen2.big.1.ordered)
lmtest.mod.sen2.1.add.val <- lmtest::lrtest(mod.sen2.con.1.ordered, mod.sen2.big.1.ordered)
lmtest.mod.sen2.2.add.con <- lmtest::lrtest(mod.sen2.val.2.ordered, mod.sen2.big.2.ordered)
lmtest.mod.sen2.2.add.val <- lmtest::lrtest(mod.sen2.con.2.ordered, mod.sen2.big.2.ordered)
lmtest.mod.sen2.3.add.con <- lmtest::lrtest(mod.sen2.val.3.ordered, mod.sen2.big.3.ordered)
lmtest.mod.sen2.3.add.val <- lmtest::lrtest(mod.sen2.con.3.ordered, mod.sen2.big.3.ordered)
lmtest.mod.sen2.4.add.con <- lmtest::lrtest(mod.sen2.val.4.ordered, mod.sen2.big.4.ordered)
lmtest.mod.sen2.4.add.val <- lmtest::lrtest(mod.sen2.con.4.ordered, mod.sen2.big.4.ordered)
lmtest.mod.sen2.5.add.con <- lmtest::lrtest(mod.sen2.val.5.ordered, mod.sen2.big.5.ordered)
lmtest.mod.sen2.5.add.val <- lmtest::lrtest(mod.sen2.con.5.ordered, mod.sen2.big.5.ordered)

lmtests.sen2 <- rbind(data.frame(Controls = "None",
                                  Model = "Congruence Added to Valence",
                                  Statistic = lmtest.mod.sen2.1.add.con$Chisq[2],
                                  pvalue = lmtest.mod.sen2.1.add.con$`Pr(>Chisq)`[2]),
                       data.frame(Controls = "None",
                                  Model = "Valence Added to Congruence",
                                  Statistic = lmtest.mod.sen2.1.add.val$Chisq[2],
                                  pvalue = lmtest.mod.sen2.1.add.val$`Pr(>Chisq)`[2]),
                       data.frame(Controls = "Ideology",
                                  Model = "Congruence Added to Valence",
                                  Statistic = lmtest.mod.sen2.2.add.con$Chisq[2],
                                  pvalue = lmtest.mod.sen2.2.add.con$`Pr(>Chisq)`[2]),
                       data.frame(Controls = "Ideology",
                                  Model = "Valence Added to Congruence",
                                  Statistic = lmtest.mod.sen2.2.add.val$Chisq[2],
                                  pvalue = lmtest.mod.sen2.2.add.val$`Pr(>Chisq)`[2]),
                       data.frame(Controls = "Ideology & Personality Interaction",
                                  Model = "Congruence Added to Valence",
                                  Statistic = lmtest.mod.sen2.3.add.con$Chisq[2],
                                  pvalue = lmtest.mod.sen2.3.add.con$`Pr(>Chisq)`[2]),
                       data.frame(Controls = "Ideology & Personality Interaction",
                                  Model = "Valence Added to Congruence",
                                  Statistic = lmtest.mod.sen2.3.add.val$Chisq[2],
                                  pvalue = lmtest.mod.sen2.3.add.val$`Pr(>Chisq)`[2]),
                       data.frame(Controls = "Ideology, Personality Interaction, and Info.",
                                  Model = "Congruence Added to Valence",
                                  Statistic = lmtest.mod.sen2.4.add.con$Chisq[2],
                                  pvalue = lmtest.mod.sen2.4.add.con$`Pr(>Chisq)`[2]),
                       data.frame(Controls = "Ideology, Personality Interaction, and Info.",
                                  Model = "Valence Added to Congruence",
                                  Statistic = lmtest.mod.sen2.4.add.val$Chisq[2],
                                  pvalue = lmtest.mod.sen2.4.add.val$`Pr(>Chisq)`[2]),
                       data.frame(Controls = "All",
                                  Model = "Congruence Added to Valence",
                                  Statistic = lmtest.mod.sen2.5.add.con$Chisq[2],
                                  pvalue = lmtest.mod.sen2.5.add.con$`Pr(>Chisq)`[2]),
                       data.frame(Controls = "All",
                                  Model = "Valence Added to Congruence",
                                  Statistic = lmtest.mod.sen2.5.add.val$Chisq[2],
                                  pvalue = lmtest.mod.sen2.5.add.val$`Pr(>Chisq)`[2]))

print(xtable(digits = 3, lmtests.sen2), file = "Table D-5.tex")


### Table B-1
texreg(file = "Table B-1.tex",
       list(mod.all.big.1.ordered, 
            mod.all.big.2.ordered, 
            mod.all.big.3.ordered, 
            mod.all.big.4.ordered, 
            mod.all.big.5.ordered), 
            stars = c(0.01, 0.05, 0.1), digits = 3,
            custom.coef.names = c("Legislator Openness", 
                                  "Legislator Conscientiousness", 
                                  "Legislator Extraversion", 
                                  "Legislator Agreeableness", 
                                  "Legislator Emotional Stability", 
                                  "Openness Divergence",
                                  "Conscientiousness Divergence",
                                  "Extraversion Divergence",
                                  "Agreeableness Divergence",
                                  "Emotional Stability Divergence",
                                  "Cutpoint 1", 
                                  "Cutpoint 2", 
                                  "Cutpoint 3",
                                  "Ideological Divergence", 
                                  "Respondent Ideology", 
                                  "Respondent Ideological Extremity",
                                  "Legislator Openness $\\times$ Respondent Ideology",
                                  "Legislator Conscientiousness $\\times$ Respondent Ideology",
                                  "Legislator Extraversion $\\times$ Respondent Ideology",
                                  "Legislator Agreeableness $\\times$ Respondent Ideology",
                                  "Legislator Emotional Stability $\\times$ Respondent Ideology",
                                  "Openness Divergence $\\times$ Respondent Ideology",
                                  "Conscientiousness Divergence $\\times$ Respondent Ideology",
                                  "Extraversion Divergence $\\times$ Respondent Ideology",
                                  "Agreeableness Divergence $\\times$ Respondent Ideology",
                                  "Emotional Stability Divergence $\\times$ Respondent Ideology",
                                  "Legislator Openness $\\times$ Respondent Ideological Extremity",
                                  "Legislator Conscientiousness $\\times$ Respondent Ideological Extremity",
                                  "Legislator Extraversion $\\times$ Respondent Ideological Extremity",
                                  "Legislator Agreeableness $\\times$ Respondent Ideological Extremity",
                                  "Legislator Emotional Stability $\\times$ Respondent Ideological Extremity",
                                  "Openness Divergence $\\times$ Respondent Ideological Extremity",
                                  "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                                  "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                                  "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                                  "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                                  "Political Information", 
                                  "Female", "Age", 
                                  "Education (1 = No HS; 6 = Postgrad)", 
                                  "Black", "Hispanic", "Other Race",
                                  "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                                  "Income Refused", 
                                  "Employed Full-Time", 
                                  "Employed Part-Time", 
                                  "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.all.big.1.ordered)$ST))), 3),
      round(t(t(unlist(summary(mod.all.big.2.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.big.3.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.big.4.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.big.5.ordered)$ST))), 3))


### Table E-7
texreg(file = "Table E-7.tex",
       list(mod.all.big.1.ordered.copartisan, 
            mod.all.big.2.ordered.copartisan, 
            mod.all.big.3.ordered.copartisan, 
            mod.all.big.4.ordered.copartisan, 
            mod.all.big.5.ordered.copartisan), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Legislator Openness", 
                             "Legislator Conscientiousness", 
                             "Legislator Extraversion", 
                             "Legislator Agreeableness", 
                             "Legislator Emotional Stability", 
                             "Openness Divergence",
                             "Conscientiousness Divergence",
                             "Extraversion Divergence",
                             "Agreeableness Divergence",
                             "Emotional Stability Divergence",
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Legislator Openness $\\times$ Respondent Ideology",
                             "Legislator Conscientiousness $\\times$ Respondent Ideology",
                             "Legislator Extraversion $\\times$ Respondent Ideology",
                             "Legislator Agreeableness $\\times$ Respondent Ideology",
                             "Legislator Emotional Stability $\\times$ Respondent Ideology",
                             "Openness Divergence $\\times$ Respondent Ideology",
                             "Conscientiousness Divergence $\\times$ Respondent Ideology",
                             "Extraversion Divergence $\\times$ Respondent Ideology",
                             "Agreeableness Divergence $\\times$ Respondent Ideology",
                             "Emotional Stability Divergence $\\times$ Respondent Ideology",
                             "Legislator Openness $\\times$ Respondent Ideological Extremity",
                             "Legislator Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Legislator Extraversion $\\times$ Respondent Ideological Extremity",
                             "Legislator Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Legislator Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Openness Divergence $\\times$ Respondent Ideological Extremity",
                             "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                             "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                             "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                             "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.all.big.1.ordered.copartisan)$ST))), 3),
      round(t(t(unlist(summary(mod.all.big.2.ordered.copartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.big.3.ordered.copartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.big.4.ordered.copartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.big.5.ordered.copartisan)$ST))), 3))


### Table F-7
texreg(file = "Table F-7.tex",
       list(mod.all.big.1.ordered.nopartisan, 
            mod.all.big.2.ordered.nopartisan, 
            mod.all.big.3.ordered.nopartisan, 
            mod.all.big.4.ordered.nopartisan, 
            mod.all.big.5.ordered.nopartisan), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Legislator Openness", 
                             "Legislator Conscientiousness", 
                             "Legislator Extraversion", 
                             "Legislator Agreeableness", 
                             "Legislator Emotional Stability", 
                             "Openness Divergence",
                             "Conscientiousness Divergence",
                             "Extraversion Divergence",
                             "Agreeableness Divergence",
                             "Emotional Stability Divergence",
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Legislator Openness $\\times$ Respondent Ideology",
                             "Legislator Conscientiousness $\\times$ Respondent Ideology",
                             "Legislator Extraversion $\\times$ Respondent Ideology",
                             "Legislator Agreeableness $\\times$ Respondent Ideology",
                             "Legislator Emotional Stability $\\times$ Respondent Ideology",
                             "Openness Divergence $\\times$ Respondent Ideology",
                             "Conscientiousness Divergence $\\times$ Respondent Ideology",
                             "Extraversion Divergence $\\times$ Respondent Ideology",
                             "Agreeableness Divergence $\\times$ Respondent Ideology",
                             "Emotional Stability Divergence $\\times$ Respondent Ideology",
                             "Legislator Openness $\\times$ Respondent Ideological Extremity",
                             "Legislator Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Legislator Extraversion $\\times$ Respondent Ideological Extremity",
                             "Legislator Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Legislator Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Openness Divergence $\\times$ Respondent Ideological Extremity",
                             "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                             "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                             "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                             "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", "Black", 
                             "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.all.big.1.ordered.nopartisan)$ST))), 3),
      round(t(t(unlist(summary(mod.all.big.2.ordered.nopartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.big.3.ordered.nopartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.big.4.ordered.nopartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.big.5.ordered.nopartisan)$ST))), 3))


### Table G-7
texreg(file = "Table G-7.tex",
       list(mod.all.big.1.ordered.lowinfo, 
            mod.all.big.2.ordered.lowinfo, 
            mod.all.big.3.ordered.lowinfo, 
            mod.all.big.4.ordered.lowinfo, 
            mod.all.big.5.ordered.lowinfo), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Legislator Openness", 
                             "Legislator Conscientiousness", 
                             "Legislator Extraversion", 
                             "Legislator Agreeableness", 
                             "Legislator Emotional Stability", 
                             "Openness Divergence",
                             "Conscientiousness Divergence",
                             "Extraversion Divergence",
                             "Agreeableness Divergence",
                             "Emotional Stability Divergence",
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Legislator Openness $\\times$ Respondent Ideology",
                             "Legislator Conscientiousness $\\times$ Respondent Ideology",
                             "Legislator Extraversion $\\times$ Respondent Ideology",
                             "Legislator Agreeableness $\\times$ Respondent Ideology",
                             "Legislator Emotional Stability $\\times$ Respondent Ideology",
                             "Openness Divergence $\\times$ Respondent Ideology",
                             "Conscientiousness Divergence $\\times$ Respondent Ideology",
                             "Extraversion Divergence $\\times$ Respondent Ideology",
                             "Agreeableness Divergence $\\times$ Respondent Ideology",
                             "Emotional Stability Divergence $\\times$ Respondent Ideology",
                             "Legislator Openness $\\times$ Respondent Ideological Extremity",
                             "Legislator Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Legislator Extraversion $\\times$ Respondent Ideological Extremity",
                             "Legislator Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Legislator Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Openness Divergence $\\times$ Respondent Ideological Extremity",
                             "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                             "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                             "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                             "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.all.big.1.ordered.lowinfo)$ST))), 3),
      round(t(t(unlist(summary(mod.all.big.2.ordered.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.big.3.ordered.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.big.4.ordered.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.big.5.ordered.lowinfo)$ST))), 3))


### Table H-7
texreg(file = "Table H-7.tex",
       list(mod.all.big.1.ordered.highinfo, 
            mod.all.big.2.ordered.highinfo, 
            mod.all.big.3.ordered.highinfo, 
            mod.all.big.4.ordered.highinfo, 
            mod.all.big.5.ordered.highinfo), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Legislator Openness", 
                             "Legislator Conscientiousness", 
                             "Legislator Extraversion", 
                             "Legislator Agreeableness", 
                             "Legislator Emotional Stability", 
                             "Openness Divergence",
                             "Conscientiousness Divergence",
                             "Extraversion Divergence",
                             "Agreeableness Divergence",
                             "Emotional Stability Divergence",
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Legislator Openness $\\times$ Respondent Ideology",
                             "Legislator Conscientiousness $\\times$ Respondent Ideology",
                             "Legislator Extraversion $\\times$ Respondent Ideology",
                             "Legislator Agreeableness $\\times$ Respondent Ideology",
                             "Legislator Emotional Stability $\\times$ Respondent Ideology",
                             "Openness Divergence $\\times$ Respondent Ideology",
                             "Conscientiousness Divergence $\\times$ Respondent Ideology",
                             "Extraversion Divergence $\\times$ Respondent Ideology",
                             "Agreeableness Divergence $\\times$ Respondent Ideology",
                             "Emotional Stability Divergence $\\times$ Respondent Ideology",
                             "Legislator Openness $\\times$ Respondent Ideological Extremity",
                             "Legislator Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Legislator Extraversion $\\times$ Respondent Ideological Extremity",
                             "Legislator Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Legislator Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Openness Divergence $\\times$ Respondent Ideological Extremity",
                             "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                             "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                             "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                             "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.all.big.1.ordered.highinfo)$ST))), 3),
      round(t(t(unlist(summary(mod.all.big.2.ordered.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.big.3.ordered.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.big.4.ordered.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.big.5.ordered.highinfo)$ST))), 3))


### Table B-2
texreg(file = "Table B-2.tex",
       list(mod.rep.big.1.ordered, 
            mod.rep.big.2.ordered, 
            mod.rep.big.3.ordered, 
            mod.rep.big.4.ordered, 
            mod.rep.big.5.ordered), 
            stars = c(0.01, 0.05, 0.1), digits = 3,
            custom.coef.names = c("Representative Openness", 
                                  "Representative Conscientiousness", 
                                  "Representative Extraversion", 
                                  "Representative Agreeableness", 
                                  "Representative Emotional Stability", 
                                  "Openness Divergence",
                                  "Conscientiousness Divergence",
                                  "Extraversion Divergence",
                                  "Agreeableness Divergence",
                                  "Emotional Stability Divergence",
                                  "Cutpoint 1", 
                                  "Cutpoint 2", 
                                  "Cutpoint 3",
                                  "Ideological Divergence", 
                                  "Respondent Ideology", 
                                  "Respondent Ideological Extremity",
                                  "Representative Openness $\\times$ Respondent Ideology",
                                  "Representative Conscientiousness $\\times$ Respondent Ideology",
                                  "Representative Extraversion $\\times$ Respondent Ideology",
                                  "Representative Agreeableness $\\times$ Respondent Ideology",
                                  "Representative Emotional Stability $\\times$ Respondent Ideology",
                                  "Openness Divergence $\\times$ Respondent Ideology",
                                  "Conscientiousness Divergence $\\times$ Respondent Ideology",
                                  "Extraversion Divergence $\\times$ Respondent Ideology",
                                  "Agreeableness Divergence $\\times$ Respondent Ideology",
                                  "Emotional Stability Divergence $\\times$ Respondent Ideology",
                                  "Representative Openness $\\times$ Respondent Ideological Extremity",
                                  "Representative Conscientiousness $\\times$ Respondent Ideological Extremity",
                                  "Representative Extraversion $\\times$ Respondent Ideological Extremity",
                                  "Representative Agreeableness $\\times$ Respondent Ideological Extremity",
                                  "Representative Emotional Stability $\\times$ Respondent Ideological Extremity",
                                  "Openness Divergence $\\times$ Respondent Ideological Extremity",
                                  "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                                  "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                                  "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                                  "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                                  "Political Information", 
                                  "Female", "Age", 
                                  "Education (1 = No HS; 6 = Postgrad)", 
                                  "Black", "Hispanic", "Other Race",
                                  "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                                  "Income Refused", 
                                  "Employed Full-Time", 
                                  "Employed Part-Time", 
                                  "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.rep.big.1.ordered)$ST))), 3),
      round(t(t(unlist(summary(mod.rep.big.2.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.big.3.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.big.4.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.big.5.ordered)$ST))), 3))


### Table E-8
texreg(file = "Table E-8.tex",
       list(mod.rep.big.1.ordered.copartisan, 
            mod.rep.big.2.ordered.copartisan, 
            mod.rep.big.3.ordered.copartisan, 
            mod.rep.big.4.ordered.copartisan, 
            mod.rep.big.5.ordered.copartisan), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Representative Openness", 
                             "Representative Conscientiousness", 
                             "Representative Extraversion", 
                             "Representative Agreeableness", 
                             "Representative Emotional Stability", 
                             "Openness Divergence",
                             "Conscientiousness Divergence",
                             "Extraversion Divergence",
                             "Agreeableness Divergence",
                             "Emotional Stability Divergence",
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Representative Openness $\\times$ Respondent Ideology",
                             "Representative Conscientiousness $\\times$ Respondent Ideology",
                             "Representative Extraversion $\\times$ Respondent Ideology",
                             "Representative Agreeableness $\\times$ Respondent Ideology",
                             "Representative Emotional Stability $\\times$ Respondent Ideology",
                             "Openness Divergence $\\times$ Respondent Ideology",
                             "Conscientiousness Divergence $\\times$ Respondent Ideology",
                             "Extraversion Divergence $\\times$ Respondent Ideology",
                             "Agreeableness Divergence $\\times$ Respondent Ideology",
                             "Emotional Stability Divergence $\\times$ Respondent Ideology",
                             "Representative Openness $\\times$ Respondent Ideological Extremity",
                             "Representative Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Representative Extraversion $\\times$ Respondent Ideological Extremity",
                             "Representative Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Representative Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Openness Divergence $\\times$ Respondent Ideological Extremity",
                             "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                             "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                             "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                             "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.rep.big.1.ordered.copartisan)$ST))), 3),
      round(t(t(unlist(summary(mod.rep.big.2.ordered.copartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.big.3.ordered.copartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.big.4.ordered.copartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.big.5.ordered.copartisan)$ST))), 3))


### Table F-8
texreg(file = "Table F-8.tex",
       list(mod.rep.big.1.ordered.nopartisan, 
            mod.rep.big.2.ordered.nopartisan, 
            mod.rep.big.3.ordered.nopartisan, 
            mod.rep.big.4.ordered.nopartisan, 
            mod.rep.big.5.ordered.nopartisan), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Representative Openness", 
                             "Representative Conscientiousness", 
                             "Representative Extraversion", 
                             "Representative Agreeableness", 
                             "Representative Emotional Stability", 
                             "Openness Divergence",
                             "Conscientiousness Divergence",
                             "Extraversion Divergence",
                             "Agreeableness Divergence",
                             "Emotional Stability Divergence",
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Representative Openness $\\times$ Respondent Ideology",
                             "Representative Conscientiousness $\\times$ Respondent Ideology",
                             "Representative Extraversion $\\times$ Respondent Ideology",
                             "Representative Agreeableness $\\times$ Respondent Ideology",
                             "Representative Emotional Stability $\\times$ Respondent Ideology",
                             "Openness Divergence $\\times$ Respondent Ideology",
                             "Conscientiousness Divergence $\\times$ Respondent Ideology",
                             "Extraversion Divergence $\\times$ Respondent Ideology",
                             "Agreeableness Divergence $\\times$ Respondent Ideology",
                             "Emotional Stability Divergence $\\times$ Respondent Ideology",
                             "Representative Openness $\\times$ Respondent Ideological Extremity",
                             "Representative Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Representative Extraversion $\\times$ Respondent Ideological Extremity",
                             "Representative Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Representative Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Openness Divergence $\\times$ Respondent Ideological Extremity",
                             "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                             "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                             "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                             "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.rep.big.1.ordered.nopartisan)$ST))), 3),
      round(t(t(unlist(summary(mod.rep.big.2.ordered.nopartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.big.3.ordered.nopartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.big.4.ordered.nopartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.big.5.ordered.nopartisan)$ST))), 3))


### Table G-8
texreg(file = "Table G-8.tex",
       list(mod.rep.big.1.ordered.lowinfo, 
            mod.rep.big.2.ordered.lowinfo, 
            mod.rep.big.3.ordered.lowinfo, 
            mod.rep.big.4.ordered.lowinfo, 
            mod.rep.big.5.ordered.lowinfo), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Representative Openness", 
                             "Representative Conscientiousness", 
                             "Representative Extraversion", 
                             "Representative Agreeableness", 
                             "Representative Emotional Stability", 
                             "Openness Divergence",
                             "Conscientiousness Divergence",
                             "Extraversion Divergence",
                             "Agreeableness Divergence",
                             "Emotional Stability Divergence",
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Representative Openness $\\times$ Respondent Ideology",
                             "Representative Conscientiousness $\\times$ Respondent Ideology",
                             "Representative Extraversion $\\times$ Respondent Ideology",
                             "Representative Agreeableness $\\times$ Respondent Ideology",
                             "Representative Emotional Stability $\\times$ Respondent Ideology",
                             "Openness Divergence $\\times$ Respondent Ideology",
                             "Conscientiousness Divergence $\\times$ Respondent Ideology",
                             "Extraversion Divergence $\\times$ Respondent Ideology",
                             "Agreeableness Divergence $\\times$ Respondent Ideology",
                             "Emotional Stability Divergence $\\times$ Respondent Ideology",
                             "Representative Openness $\\times$ Respondent Ideological Extremity",
                             "Representative Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Representative Extraversion $\\times$ Respondent Ideological Extremity",
                             "Representative Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Representative Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Openness Divergence $\\times$ Respondent Ideological Extremity",
                             "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                             "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                             "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                             "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.rep.big.1.ordered.lowinfo)$ST))), 3),
      round(t(t(unlist(summary(mod.rep.big.2.ordered.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.big.3.ordered.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.big.4.ordered.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.big.5.ordered.lowinfo)$ST))), 3))


### Table H-8
texreg(file = "Table H-8.tex",
       list(mod.rep.big.1.ordered.highinfo, 
            mod.rep.big.2.ordered.highinfo, 
            mod.rep.big.3.ordered.highinfo, 
            mod.rep.big.4.ordered.highinfo, 
            mod.rep.big.5.ordered.highinfo), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Representative Openness", 
                             "Representative Conscientiousness", 
                             "Representative Extraversion", 
                             "Representative Agreeableness", 
                             "Representative Emotional Stability", 
                             "Openness Divergence",
                             "Conscientiousness Divergence",
                             "Extraversion Divergence",
                             "Agreeableness Divergence",
                             "Emotional Stability Divergence",
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Representative Openness $\\times$ Respondent Ideology",
                             "Representative Conscientiousness $\\times$ Respondent Ideology",
                             "Representative Extraversion $\\times$ Respondent Ideology",
                             "Representative Agreeableness $\\times$ Respondent Ideology",
                             "Representative Emotional Stability $\\times$ Respondent Ideology",
                             "Openness Divergence $\\times$ Respondent Ideology",
                             "Conscientiousness Divergence $\\times$ Respondent Ideology",
                             "Extraversion Divergence $\\times$ Respondent Ideology",
                             "Agreeableness Divergence $\\times$ Respondent Ideology",
                             "Emotional Stability Divergence $\\times$ Respondent Ideology",
                             "Representative Openness $\\times$ Respondent Ideological Extremity",
                             "Representative Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Representative Extraversion $\\times$ Respondent Ideological Extremity",
                             "Representative Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Representative Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Openness Divergence $\\times$ Respondent Ideological Extremity",
                             "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                             "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                             "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                             "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.rep.big.1.ordered.highinfo)$ST))), 3),
      round(t(t(unlist(summary(mod.rep.big.2.ordered.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.big.3.ordered.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.big.4.ordered.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.big.5.ordered.highinfo)$ST))), 3))


### Table B-3
texreg(file = "Table B-3.tex",
       list(mod.sen.big.1.ordered, 
            mod.sen.big.2.ordered, 
            mod.sen.big.3.ordered, 
            mod.sen.big.4.ordered, 
            mod.sen.big.5.ordered), 
            stars = c(0.01, 0.05, 0.1), digits = 3,
            custom.coef.names = c("Senator Openness", 
                                  "Senator Conscientiousness", 
                                  "Senator Extraversion", 
                                  "Senator Agreeableness", 
                                  "Senator Emotional Stability", 
                                  "Openness Divergence",
                                  "Conscientiousness Divergence",
                                  "Extraversion Divergence",
                                  "Agreeableness Divergence",
                                  "Emotional Stability Divergence",
                                  "Cutpoint 1", 
                                  "Cutpoint 2", 
                                  "Cutpoint 3",
                                  "Ideological Divergence", 
                                  "Respondent Ideology", 
                                  "Respondent Ideological Extremity",
                                  "Senator Openness $\\times$ Respondent Ideology",
                                  "Senator Conscientiousness $\\times$ Respondent Ideology",
                                  "Senator Extraversion $\\times$ Respondent Ideology",
                                  "Senator Agreeableness $\\times$ Respondent Ideology",
                                  "Senator Emotional Stability $\\times$ Respondent Ideology",
                                  "Openness Divergence $\\times$ Respondent Ideology",
                                  "Conscientiousness Divergence $\\times$ Respondent Ideology",
                                  "Extraversion Divergence $\\times$ Respondent Ideology",
                                  "Agreeableness Divergence $\\times$ Respondent Ideology",
                                  "Emotional Stability Divergence $\\times$ Respondent Ideology",
                                  "Senator Openness $\\times$ Respondent Ideological Extremity",
                                  "Senator Conscientiousness $\\times$ Respondent Ideological Extremity",
                                  "Senator Extraversion $\\times$ Respondent Ideological Extremity",
                                  "Senator Agreeableness $\\times$ Respondent Ideological Extremity",
                                  "Senator Emotional Stability $\\times$ Respondent Ideological Extremity",
                                  "Openness Divergence $\\times$ Respondent Ideological Extremity",
                                  "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                                  "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                                  "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                                  "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                                  "Political Information", 
                                  "Female", "Age", 
                                  "Education (1 = No HS; 6 = Postgrad)", 
                                  "Black", "Hispanic", "Other Race",
                                  "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                                  "Income Refused", 
                                  "Employed Full-Time", 
                                  "Employed Part-Time", 
                                  "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.sen.big.1.ordered)$ST))), 3),
      round(t(t(unlist(summary(mod.sen.big.2.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.big.3.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.big.4.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.big.5.ordered)$ST))), 3))


### Table E-9
texreg(file = "Table E-9.tex",
       list(mod.sen.big.1.ordered.copartisan, 
            mod.sen.big.2.ordered.copartisan, 
            mod.sen.big.3.ordered.copartisan, 
            mod.sen.big.4.ordered.copartisan, 
            mod.sen.big.5.ordered.copartisan), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Senator Openness", 
                             "Senator Conscientiousness", 
                             "Senator Extraversion", 
                             "Senator Agreeableness", 
                             "Senator Emotional Stability", 
                             "Openness Divergence",
                             "Conscientiousness Divergence",
                             "Extraversion Divergence",
                             "Agreeableness Divergence",
                             "Emotional Stability Divergence",
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Senator Openness $\\times$ Respondent Ideology",
                             "Senator Conscientiousness $\\times$ Respondent Ideology",
                             "Senator Extraversion $\\times$ Respondent Ideology",
                             "Senator Agreeableness $\\times$ Respondent Ideology",
                             "Senator Emotional Stability $\\times$ Respondent Ideology",
                             "Openness Divergence $\\times$ Respondent Ideology",
                             "Conscientiousness Divergence $\\times$ Respondent Ideology",
                             "Extraversion Divergence $\\times$ Respondent Ideology",
                             "Agreeableness Divergence $\\times$ Respondent Ideology",
                             "Emotional Stability Divergence $\\times$ Respondent Ideology",
                             "Senator Openness $\\times$ Respondent Ideological Extremity",
                             "Senator Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Senator Extraversion $\\times$ Respondent Ideological Extremity",
                             "Senator Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Senator Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Openness Divergence $\\times$ Respondent Ideological Extremity",
                             "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                             "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                             "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                             "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.sen.big.1.ordered.copartisan)$ST))), 3),
      round(t(t(unlist(summary(mod.sen.big.2.ordered.copartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.big.3.ordered.copartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.big.4.ordered.copartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.big.5.ordered.copartisan)$ST))), 3))


### Table F-9
texreg(file = "Table F-9.tex",
       list(mod.sen.big.1.ordered.nopartisan, 
            mod.sen.big.2.ordered.nopartisan, 
            mod.sen.big.3.ordered.nopartisan, 
            mod.sen.big.4.ordered.nopartisan, 
            mod.sen.big.5.ordered.nopartisan), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Senator Openness", 
                             "Senator Conscientiousness", 
                             "Senator Extraversion", 
                             "Senator Agreeableness", 
                             "Senator Emotional Stability", 
                             "Openness Divergence",
                             "Conscientiousness Divergence",
                             "Extraversion Divergence",
                             "Agreeableness Divergence",
                             "Emotional Stability Divergence",
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Senator Openness $\\times$ Respondent Ideology",
                             "Senator Conscientiousness $\\times$ Respondent Ideology",
                             "Senator Extraversion $\\times$ Respondent Ideology",
                             "Senator Agreeableness $\\times$ Respondent Ideology",
                             "Senator Emotional Stability $\\times$ Respondent Ideology",
                             "Openness Divergence $\\times$ Respondent Ideology",
                             "Conscientiousness Divergence $\\times$ Respondent Ideology",
                             "Extraversion Divergence $\\times$ Respondent Ideology",
                             "Agreeableness Divergence $\\times$ Respondent Ideology",
                             "Emotional Stability Divergence $\\times$ Respondent Ideology",
                             "Senator Openness $\\times$ Respondent Ideological Extremity",
                             "Senator Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Senator Extraversion $\\times$ Respondent Ideological Extremity",
                             "Senator Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Senator Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Openness Divergence $\\times$ Respondent Ideological Extremity",
                             "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                             "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                             "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                             "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.sen.big.1.ordered.nopartisan)$ST))), 3),
      round(t(t(unlist(summary(mod.sen.big.2.ordered.nopartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.big.3.ordered.nopartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.big.4.ordered.nopartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.big.5.ordered.nopartisan)$ST))), 3))


### Table G-9
texreg(file = "Table G-9.tex",
       list(mod.sen.big.1.ordered.lowinfo, 
            mod.sen.big.2.ordered.lowinfo, 
            mod.sen.big.3.ordered.lowinfo, 
            mod.sen.big.4.ordered.lowinfo, 
            mod.sen.big.5.ordered.lowinfo), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Senator Openness", 
                             "Senator Conscientiousness", 
                             "Senator Extraversion", 
                             "Senator Agreeableness", 
                             "Senator Emotional Stability", 
                             "Openness Divergence",
                             "Conscientiousness Divergence",
                             "Extraversion Divergence",
                             "Agreeableness Divergence",
                             "Emotional Stability Divergence",
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Senator Openness $\\times$ Respondent Ideology",
                             "Senator Conscientiousness $\\times$ Respondent Ideology",
                             "Senator Extraversion $\\times$ Respondent Ideology",
                             "Senator Agreeableness $\\times$ Respondent Ideology",
                             "Senator Emotional Stability $\\times$ Respondent Ideology",
                             "Openness Divergence $\\times$ Respondent Ideology",
                             "Conscientiousness Divergence $\\times$ Respondent Ideology",
                             "Extraversion Divergence $\\times$ Respondent Ideology",
                             "Agreeableness Divergence $\\times$ Respondent Ideology",
                             "Emotional Stability Divergence $\\times$ Respondent Ideology",
                             "Senator Openness $\\times$ Respondent Ideological Extremity",
                             "Senator Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Senator Extraversion $\\times$ Respondent Ideological Extremity",
                             "Senator Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Senator Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Openness Divergence $\\times$ Respondent Ideological Extremity",
                             "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                             "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                             "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                             "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.sen.big.1.ordered.lowinfo)$ST))), 3),
      round(t(t(unlist(summary(mod.sen.big.2.ordered.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.big.3.ordered.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.big.4.ordered.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.big.5.ordered.lowinfo)$ST))), 3))


### Table H-9
texreg(file = "Table H-9.tex",
       list(mod.sen.big.1.ordered.highinfo, 
            mod.sen.big.2.ordered.highinfo, 
            mod.sen.big.3.ordered.highinfo, 
            mod.sen.big.4.ordered.highinfo, 
            mod.sen.big.5.ordered.highinfo), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Senator Openness", 
                             "Senator Conscientiousness", 
                             "Senator Extraversion", 
                             "Senator Agreeableness", 
                             "Senator Emotional Stability", 
                             "Openness Divergence",
                             "Conscientiousness Divergence",
                             "Extraversion Divergence",
                             "Agreeableness Divergence",
                             "Emotional Stability Divergence",
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Senator Openness $\\times$ Respondent Ideology",
                             "Senator Conscientiousness $\\times$ Respondent Ideology",
                             "Senator Extraversion $\\times$ Respondent Ideology",
                             "Senator Agreeableness $\\times$ Respondent Ideology",
                             "Senator Emotional Stability $\\times$ Respondent Ideology",
                             "Openness Divergence $\\times$ Respondent Ideology",
                             "Conscientiousness Divergence $\\times$ Respondent Ideology",
                             "Extraversion Divergence $\\times$ Respondent Ideology",
                             "Agreeableness Divergence $\\times$ Respondent Ideology",
                             "Emotional Stability Divergence $\\times$ Respondent Ideology",
                             "Senator Openness $\\times$ Respondent Ideological Extremity",
                             "Senator Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Senator Extraversion $\\times$ Respondent Ideological Extremity",
                             "Senator Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Senator Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Openness Divergence $\\times$ Respondent Ideological Extremity",
                             "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                             "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                             "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                             "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.sen.big.1.ordered.highinfo)$ST))), 3),
      round(t(t(unlist(summary(mod.sen.big.2.ordered.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.big.3.ordered.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.big.4.ordered.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.big.5.ordered.highinfo)$ST))), 3))


### Table C-4
texreg(file = "Table C-4.tex",
       list(mod.obama.big.1.ordered, 
            mod.obama.big.2.ordered, 
            mod.obama.big.3.ordered, 
            mod.obama.big.4.ordered, 
            mod.obama.big.5.ordered), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Obama Openness", 
                             "Obama Conscientiousness", 
                             "Obama Extraversion", 
                             "Obama Agreeableness", 
                             "Obama Emotional Stability", 
                             "Openness Divergence",
                             "Conscientiousness Divergence",
                             "Extraversion Divergence",
                             "Agreeableness Divergence",
                             "Emotional Stability Divergence",
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Obama Openness $\\times$ Respondent Ideology",
                             "Obama Conscientiousness $\\times$ Respondent Ideology",
                             "Obama Extraversion $\\times$ Respondent Ideology",
                             "Obama Agreeableness $\\times$ Respondent Ideology",
                             "Obama Emotional Stability $\\times$ Respondent Ideology",
                             "Openness Divergence $\\times$ Respondent Ideology",
                             "Conscientiousness Divergence $\\times$ Respondent Ideology",
                             "Extraversion Divergence $\\times$ Respondent Ideology",
                             "Agreeableness Divergence $\\times$ Respondent Ideology",
                             "Emotional Stability Divergence $\\times$ Respondent Ideology",
                             "Obama Openness $\\times$ Respondent Ideological Extremity",
                             "Obama Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Obama Extraversion $\\times$ Respondent Ideological Extremity",
                             "Obama Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Obama Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Openness Divergence $\\times$ Respondent Ideological Extremity",
                             "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                             "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                             "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                             "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)",
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.obama.big.1.ordered)$ST))), 3),
      round(t(t(unlist(summary(mod.obama.big.2.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.obama.big.3.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.obama.big.4.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.obama.big.5.ordered)$ST))), 3))


### Table D-3
texreg(file = "Table D-3.tex",
       list(mod.sen2.big.1.ordered, 
            mod.sen2.big.2.ordered, 
            mod.sen2.big.3.ordered, 
            mod.sen2.big.4.ordered, 
            mod.sen2.big.5.ordered), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Senator Openness", 
                             "Senator Conscientiousness", 
                             "Senator Extraversion", 
                             "Senator Agreeableness", 
                             "Senator Emotional Stability", 
                             "Openness Divergence",
                             "Conscientiousness Divergence",
                             "Extraversion Divergence",
                             "Agreeableness Divergence",
                             "Emotional Stability Divergence",
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Senator Openness $\\times$ Respondent Ideology",
                             "Senator Conscientiousness $\\times$ Respondent Ideology",
                             "Senator Extraversion $\\times$ Respondent Ideology",
                             "Senator Agreeableness $\\times$ Respondent Ideology",
                             "Senator Emotional Stability $\\times$ Respondent Ideology",
                             "Openness Divergence $\\times$ Respondent Ideology",
                             "Conscientiousness Divergence $\\times$ Respondent Ideology",
                             "Extraversion Divergence $\\times$ Respondent Ideology",
                             "Agreeableness Divergence $\\times$ Respondent Ideology",
                             "Emotional Stability Divergence $\\times$ Respondent Ideology",
                             "Senator Openness $\\times$ Respondent Ideological Extremity",
                             "Senator Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Senator Extraversion $\\times$ Respondent Ideological Extremity",
                             "Senator Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Senator Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Openness Divergence $\\times$ Respondent Ideological Extremity",
                             "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                             "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                             "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                             "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.sen2.big.1.ordered)$ST))), 3),
      round(t(t(unlist(summary(mod.sen2.big.2.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen2.big.3.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen2.big.4.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen2.big.5.ordered)$ST))), 3))


### Table A-1
texreg(file = "Table A-1.tex",
       list(mod.all.val.1.ordered, 
            mod.all.val.2.ordered, 
            mod.all.val.3.ordered, 
            mod.all.val.4.ordered, 
            mod.all.val.5.ordered), 
            stars = c(0.01, 0.05, 0.1), digits = 3,
            custom.coef.names = c("Legislator Openness", 
                                  "Legislator Conscientiousness", 
                                  "Legislator Extraversion", 
                                  "Legislator Agreeableness", 
                                  "Legislator Emotional Stability", 
                                  "Cutpoint 1", 
                                  "Cutpoint 2", 
                                  "Cutpoint 3",
                                  "Ideological Divergence", 
                                  "Respondent Ideology", 
                                  "Respondent Ideological Extremity",
                                  "Legislator Openness $\\times$ Respondent Ideology",
                                  "Legislator Conscientiousness $\\times$ Respondent Ideology",
                                  "Legislator Extraversion $\\times$ Respondent Ideology",
                                  "Legislator Agreeableness $\\times$ Respondent Ideology",
                                  "Legislator Emotional Stability $\\times$ Respondent Ideology",
                                  "Legislator Openness $\\times$ Respondent Ideological Extremity",
                                  "Legislator Conscientiousness $\\times$ Respondent Ideological Extremity",
                                  "Legislator Extraversion $\\times$ Respondent Ideological Extremity",
                                  "Legislator Agreeableness $\\times$ Respondent Ideological Extremity",
                                  "Legislator Emotional Stability $\\times$ Respondent Ideological Extremity",
                                  "Political Information", 
                                  "Female", "Age", 
                                  "Education (1 = No HS; 6 = Postgrad)", 
                                  "Black", "Hispanic", "Other Race",
                                  "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                                  "Income Refused", 
                                  "Employed Full-Time", 
                                  "Employed Part-Time", 
                                  "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.all.val.1.ordered)$ST))), 3),
      round(t(t(unlist(summary(mod.all.val.2.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.val.3.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.val.4.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.val.5.ordered)$ST))), 3))


### Table E-1
texreg(file = "Table E-1.tex",
       list(mod.all.val.1.ordered.copartisan, 
            mod.all.val.2.ordered.copartisan, 
            mod.all.val.3.ordered.copartisan, 
            mod.all.val.4.ordered.copartisan, 
            mod.all.val.5.ordered.copartisan), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Legislator Openness", 
                             "Legislator Conscientiousness", 
                             "Legislator Extraversion", 
                             "Legislator Agreeableness", 
                             "Legislator Emotional Stability", 
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Legislator Openness $\\times$ Respondent Ideology",
                             "Legislator Conscientiousness $\\times$ Respondent Ideology",
                             "Legislator Extraversion $\\times$ Respondent Ideology",
                             "Legislator Agreeableness $\\times$ Respondent Ideology",
                             "Legislator Emotional Stability $\\times$ Respondent Ideology",
                             "Legislator Openness $\\times$ Respondent Ideological Extremity",
                             "Legislator Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Legislator Extraversion $\\times$ Respondent Ideological Extremity",
                             "Legislator Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Legislator Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.all.val.1.ordered.copartisan)$ST))), 3),
      round(t(t(unlist(summary(mod.all.val.2.ordered.copartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.val.3.ordered.copartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.val.4.ordered.copartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.val.5.ordered.copartisan)$ST))), 3))


### Table F-1
texreg(file = "Table F-1.tex",
       list(mod.all.val.1.ordered.nopartisan, 
            mod.all.val.2.ordered.nopartisan, 
            mod.all.val.3.ordered.nopartisan, 
            mod.all.val.4.ordered.nopartisan, 
            mod.all.val.5.ordered.nopartisan), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Legislator Openness", 
                             "Legislator Conscientiousness", 
                             "Legislator Extraversion", 
                             "Legislator Agreeableness", 
                             "Legislator Emotional Stability", 
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Legislator Openness $\\times$ Respondent Ideology",
                             "Legislator Conscientiousness $\\times$ Respondent Ideology",
                             "Legislator Extraversion $\\times$ Respondent Ideology",
                             "Legislator Agreeableness $\\times$ Respondent Ideology",
                             "Legislator Emotional Stability $\\times$ Respondent Ideology",
                             "Legislator Openness $\\times$ Respondent Ideological Extremity",
                             "Legislator Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Legislator Extraversion $\\times$ Respondent Ideological Extremity",
                             "Legislator Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Legislator Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.all.val.1.ordered.nopartisan)$ST))), 3),
      round(t(t(unlist(summary(mod.all.val.2.ordered.nopartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.val.3.ordered.nopartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.val.4.ordered.nopartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.val.5.ordered.nopartisan)$ST))), 3))


### Table G-1
texreg(file = "Table G-1.tex",
       list(mod.all.val.1.ordered.lowinfo, 
            mod.all.val.2.ordered.lowinfo, 
            mod.all.val.3.ordered.lowinfo, 
            mod.all.val.4.ordered.lowinfo, 
            mod.all.val.5.ordered.lowinfo), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Legislator Openness", 
                             "Legislator Conscientiousness", 
                             "Legislator Extraversion", 
                             "Legislator Agreeableness", 
                             "Legislator Emotional Stability", 
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Legislator Openness $\\times$ Respondent Ideology",
                             "Legislator Conscientiousness $\\times$ Respondent Ideology",
                             "Legislator Extraversion $\\times$ Respondent Ideology",
                             "Legislator Agreeableness $\\times$ Respondent Ideology",
                             "Legislator Emotional Stability $\\times$ Respondent Ideology",
                             "Legislator Openness $\\times$ Respondent Ideological Extremity",
                             "Legislator Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Legislator Extraversion $\\times$ Respondent Ideological Extremity",
                             "Legislator Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Legislator Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.all.val.1.ordered.lowinfo)$ST))), 3),
      round(t(t(unlist(summary(mod.all.val.2.ordered.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.val.3.ordered.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.val.4.ordered.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.val.5.ordered.lowinfo)$ST))), 3))


### Table H-1
texreg(file = "Table H-1.tex",
       list(mod.all.val.1.ordered.highinfo, 
            mod.all.val.2.ordered.highinfo, 
            mod.all.val.3.ordered.highinfo, 
            mod.all.val.4.ordered.highinfo, 
            mod.all.val.5.ordered.highinfo), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Legislator Openness", 
                             "Legislator Conscientiousness", 
                             "Legislator Extraversion", 
                             "Legislator Agreeableness", 
                             "Legislator Emotional Stability", 
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Legislator Openness $\\times$ Respondent Ideology",
                             "Legislator Conscientiousness $\\times$ Respondent Ideology",
                             "Legislator Extraversion $\\times$ Respondent Ideology",
                             "Legislator Agreeableness $\\times$ Respondent Ideology",
                             "Legislator Emotional Stability $\\times$ Respondent Ideology",
                             "Legislator Openness $\\times$ Respondent Ideological Extremity",
                             "Legislator Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Legislator Extraversion $\\times$ Respondent Ideological Extremity",
                             "Legislator Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Legislator Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.all.val.1.ordered.highinfo)$ST))), 3),
      round(t(t(unlist(summary(mod.all.val.2.ordered.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.val.3.ordered.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.val.4.ordered.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.val.5.ordered.highinfo)$ST))), 3))


### Table A-2
texreg(file = "Table A-2.tex",
       list(mod.rep.val.1.ordered, 
            mod.rep.val.2.ordered, 
            mod.rep.val.3.ordered, 
            mod.rep.val.4.ordered, 
            mod.rep.val.5.ordered), 
            stars = c(0.01, 0.05, 0.1), digits = 3,
            custom.coef.names = c("Representative Openness", 
                                  "Representative Conscientiousness", 
                                  "Representative Extraversion", 
                                  "Representative Agreeableness", 
                                  "Representative Emotional Stability", 
                                  "Cutpoint 1", 
                                  "Cutpoint 2", 
                                  "Cutpoint 3",
                                  "Ideological Divergence", 
                                  "Respondent Ideology", 
                                  "Respondent Ideological Extremity",
                                  "Representative Openness $\\times$ Respondent Ideology",
                                  "Representative Conscientiousness $\\times$ Respondent Ideology",
                                  "Representative Extraversion $\\times$ Respondent Ideology",
                                  "Representative Agreeableness $\\times$ Respondent Ideology",
                                  "Representative Emotional Stability $\\times$ Respondent Ideology",
                                  "Representative Openness $\\times$ Respondent Ideological Extremity",
                                  "Representative Conscientiousness $\\times$ Respondent Ideological Extremity",
                                  "Representative Extraversion $\\times$ Respondent Ideological Extremity",
                                  "Representative Agreeableness $\\times$ Respondent Ideological Extremity",
                                  "Representative Emotional Stability $\\times$ Respondent Ideological Extremity",
                                  "Political Information", 
                                  "Female", "Age", 
                                  "Education (1 = No HS; 6 = Postgrad)", 
                                  "Black", "Hispanic", "Other Race",
                                  "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                                  "Income Refused", 
                                  "Employed Full-Time", 
                                  "Employed Part-Time", 
                                  "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.rep.val.1.ordered)$ST))), 3),
      round(t(t(unlist(summary(mod.rep.val.2.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.val.3.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.val.4.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.val.5.ordered)$ST))), 3))

### Table E-2
texreg(file = "Table E-2.tex",
       list(mod.rep.val.1.ordered.copartisan, 
            mod.rep.val.2.ordered.copartisan, 
            mod.rep.val.3.ordered.copartisan, 
            mod.rep.val.4.ordered.copartisan, 
            mod.rep.val.5.ordered.copartisan), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Representative Openness", 
                             "Representative Conscientiousness", 
                             "Representative Extraversion", 
                             "Representative Agreeableness", 
                             "Representative Emotional Stability", 
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", "Respondent Ideological Extremity",
                             "Representative Openness $\\times$ Respondent Ideology",
                             "Representative Conscientiousness $\\times$ Respondent Ideology",
                             "Representative Extraversion $\\times$ Respondent Ideology",
                             "Representative Agreeableness $\\times$ Respondent Ideology",
                             "Representative Emotional Stability $\\times$ Respondent Ideology",
                             "Representative Openness $\\times$ Respondent Ideological Extremity",
                             "Representative Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Representative Extraversion $\\times$ Respondent Ideological Extremity",
                             "Representative Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Representative Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.rep.val.1.ordered.copartisan)$ST))), 3),
      round(t(t(unlist(summary(mod.rep.val.2.ordered.copartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.val.3.ordered.copartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.val.4.ordered.copartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.val.5.ordered.copartisan)$ST))), 3))


### Table F-2
texreg(file = "Table F-2.tex",
       list(mod.rep.val.1.ordered.nopartisan, 
            mod.rep.val.2.ordered.nopartisan, 
            mod.rep.val.3.ordered.nopartisan, 
            mod.rep.val.4.ordered.nopartisan, 
            mod.rep.val.5.ordered.nopartisan), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Representative Openness", 
                             "Representative Conscientiousness", 
                             "Representative Extraversion", 
                             "Representative Agreeableness", 
                             "Representative Emotional Stability", 
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Representative Openness $\\times$ Respondent Ideology",
                             "Representative Conscientiousness $\\times$ Respondent Ideology",
                             "Representative Extraversion $\\times$ Respondent Ideology",
                             "Representative Agreeableness $\\times$ Respondent Ideology",
                             "Representative Emotional Stability $\\times$ Respondent Ideology",
                             "Representative Openness $\\times$ Respondent Ideological Extremity",
                             "Representative Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Representative Extraversion $\\times$ Respondent Ideological Extremity",
                             "Representative Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Representative Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.rep.val.1.ordered.nopartisan)$ST))), 3),
      round(t(t(unlist(summary(mod.rep.val.2.ordered.nopartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.val.3.ordered.nopartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.val.4.ordered.nopartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.val.5.ordered.nopartisan)$ST))), 3))


### Table G-2
texreg(file = "Table G-2.tex",
       list(mod.rep.val.1.ordered.lowinfo, 
            mod.rep.val.2.ordered.lowinfo, 
            mod.rep.val.3.ordered.lowinfo, 
            mod.rep.val.4.ordered.lowinfo, 
            mod.rep.val.5.ordered.lowinfo), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Representative Openness", 
                             "Representative Conscientiousness", 
                             "Representative Extraversion", 
                             "Representative Agreeableness", 
                             "Representative Emotional Stability", 
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Representative Openness $\\times$ Respondent Ideology",
                             "Representative Conscientiousness $\\times$ Respondent Ideology",
                             "Representative Extraversion $\\times$ Respondent Ideology",
                             "Representative Agreeableness $\\times$ Respondent Ideology",
                             "Representative Emotional Stability $\\times$ Respondent Ideology",
                             "Representative Openness $\\times$ Respondent Ideological Extremity",
                             "Representative Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Representative Extraversion $\\times$ Respondent Ideological Extremity",
                             "Representative Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Representative Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.rep.val.1.ordered.lowinfo)$ST))), 3),
      round(t(t(unlist(summary(mod.rep.val.2.ordered.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.val.3.ordered.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.val.4.ordered.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.val.5.ordered.lowinfo)$ST))), 3))


### Table H-2
texreg(file = "Table H-2.tex",
       list(mod.rep.val.1.ordered.highinfo, 
            mod.rep.val.2.ordered.highinfo, 
            mod.rep.val.3.ordered.highinfo, 
            mod.rep.val.4.ordered.highinfo, 
            mod.rep.val.5.ordered.highinfo), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Representative Openness", 
                             "Representative Conscientiousness", 
                             "Representative Extraversion", 
                             "Representative Agreeableness", 
                             "Representative Emotional Stability", 
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Representative Openness $\\times$ Respondent Ideology",
                             "Representative Conscientiousness $\\times$ Respondent Ideology",
                             "Representative Extraversion $\\times$ Respondent Ideology",
                             "Representative Agreeableness $\\times$ Respondent Ideology",
                             "Representative Emotional Stability $\\times$ Respondent Ideology",
                             "Representative Openness $\\times$ Respondent Ideological Extremity",
                             "Representative Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Representative Extraversion $\\times$ Respondent Ideological Extremity",
                             "Representative Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Representative Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.rep.val.1.ordered.highinfo)$ST))), 3),
      round(t(t(unlist(summary(mod.rep.val.2.ordered.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.val.3.ordered.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.val.4.ordered.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.val.5.ordered.highinfo)$ST))), 3))


### Table A-3
texreg(file = "Table A-3.tex",
       list(mod.sen.val.1.ordered, 
            mod.sen.val.2.ordered, 
            mod.sen.val.3.ordered, 
            mod.sen.val.4.ordered, 
            mod.sen.val.5.ordered), 
            stars = c(0.01, 0.05, 0.1), digits = 3,
            custom.coef.names = c("Senator Openness", "Senator Conscientiousness", 
                                  "Senator Extraversion", "Senator Agreeableness", 
                                  "Senator Emotional Stability", 
                                  "Cutpoint 1", "Cutpoint 2", "Cutpoint 3",
                                  "Ideological Divergence", 
                                  "Respondent Ideology", "Respondent Ideological Extremity",
                                  "Senator Openness $\\times$ Respondent Ideology",
                                  "Senator Conscientiousness $\\times$ Respondent Ideology",
                                  "Senator Extraversion $\\times$ Respondent Ideology",
                                  "Senator Agreeableness $\\times$ Respondent Ideology",
                                  "Senator Emotional Stability $\\times$ Respondent Ideology",
                                  "Senator Openness $\\times$ Respondent Ideological Extremity",
                                  "Senator Conscientiousness $\\times$ Respondent Ideological Extremity",
                                  "Senator Extraversion $\\times$ Respondent Ideological Extremity",
                                  "Senator Agreeableness $\\times$ Respondent Ideological Extremity",
                                  "Senator Emotional Stability $\\times$ Respondent Ideological Extremity",
                                  "Political Information", 
                                  "Female", "Age", 
                                  "Education (1 = No HS; 6 = Postgrad)", "Black", "Hispanic", "Other Race",
                                  "Income (1 = <10k; 12 = >150k; 13 = Refused)", "Income Refused", 
                                  "Employed Full-Time", "Employed Part-Time", "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.sen.val.1.ordered)$ST))), 3),
      round(t(t(unlist(summary(mod.sen.val.2.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.val.3.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.val.4.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.val.5.ordered)$ST))), 3))


### Table E-3
texreg(file = "Table E-3.tex",
       list(mod.sen.val.1.ordered.copartisan, 
            mod.sen.val.2.ordered.copartisan, 
            mod.sen.val.3.ordered.copartisan, 
            mod.sen.val.4.ordered.copartisan, 
            mod.sen.val.5.ordered.copartisan), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Senator Openness", "Senator Conscientiousness", 
                             "Senator Extraversion", "Senator Agreeableness", 
                             "Senator Emotional Stability", 
                             "Cutpoint 1", "Cutpoint 2", "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", "Respondent Ideological Extremity",
                             "Senator Openness $\\times$ Respondent Ideology",
                             "Senator Conscientiousness $\\times$ Respondent Ideology",
                             "Senator Extraversion $\\times$ Respondent Ideology",
                             "Senator Agreeableness $\\times$ Respondent Ideology",
                             "Senator Emotional Stability $\\times$ Respondent Ideology",
                             "Senator Openness $\\times$ Respondent Ideological Extremity",
                             "Senator Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Senator Extraversion $\\times$ Respondent Ideological Extremity",
                             "Senator Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Senator Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", "Income Refused", 
                             "Employed Full-Time", "Employed Part-Time", "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.sen.val.1.ordered.copartisan)$ST))), 3),
      round(t(t(unlist(summary(mod.sen.val.2.ordered.copartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.val.3.ordered.copartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.val.4.ordered.copartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.val.5.ordered.copartisan)$ST))), 3))


### Table F-3
texreg(file = "Table F-3.tex",
       list(mod.sen.val.1.ordered.nopartisan, 
            mod.sen.val.2.ordered.nopartisan, 
            mod.sen.val.3.ordered.nopartisan, 
            mod.sen.val.4.ordered.nopartisan, 
            mod.sen.val.5.ordered.nopartisan), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Senator Openness", "Senator Conscientiousness", 
                             "Senator Extraversion", "Senator Agreeableness", 
                             "Senator Emotional Stability", 
                             "Cutpoint 1", "Cutpoint 2", "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", "Respondent Ideological Extremity",
                             "Senator Openness $\\times$ Respondent Ideology",
                             "Senator Conscientiousness $\\times$ Respondent Ideology",
                             "Senator Extraversion $\\times$ Respondent Ideology",
                             "Senator Agreeableness $\\times$ Respondent Ideology",
                             "Senator Emotional Stability $\\times$ Respondent Ideology",
                             "Senator Openness $\\times$ Respondent Ideological Extremity",
                             "Senator Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Senator Extraversion $\\times$ Respondent Ideological Extremity",
                             "Senator Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Senator Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", "Income Refused", 
                             "Employed Full-Time", "Employed Part-Time", "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.sen.val.1.ordered.nopartisan)$ST))), 3),
      round(t(t(unlist(summary(mod.sen.val.2.ordered.nopartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.val.3.ordered.nopartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.val.4.ordered.nopartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.val.5.ordered.nopartisan)$ST))), 3))


### Table G-3
texreg(file = "Table G-3.tex",
       list(mod.sen.val.1.ordered.lowinfo, 
            mod.sen.val.2.ordered.lowinfo, 
            mod.sen.val.3.ordered.lowinfo, 
            mod.sen.val.4.ordered.lowinfo, 
            mod.sen.val.5.ordered.lowinfo), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Senator Openness", "Senator Conscientiousness", 
                             "Senator Extraversion", "Senator Agreeableness", 
                             "Senator Emotional Stability", 
                             "Cutpoint 1", "Cutpoint 2", "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", "Respondent Ideological Extremity",
                             "Senator Openness $\\times$ Respondent Ideology",
                             "Senator Conscientiousness $\\times$ Respondent Ideology",
                             "Senator Extraversion $\\times$ Respondent Ideology",
                             "Senator Agreeableness $\\times$ Respondent Ideology",
                             "Senator Emotional Stability $\\times$ Respondent Ideology",
                             "Senator Openness $\\times$ Respondent Ideological Extremity",
                             "Senator Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Senator Extraversion $\\times$ Respondent Ideological Extremity",
                             "Senator Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Senator Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", "Income Refused", 
                             "Employed Full-Time", "Employed Part-Time", "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.sen.val.1.ordered.lowinfo)$ST))), 3),
      round(t(t(unlist(summary(mod.sen.val.2.ordered.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.val.3.ordered.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.val.4.ordered.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.val.5.ordered.lowinfo)$ST))), 3))


### Table H-3
texreg(file = "Table H-3.tex",
       list(mod.sen.val.1.ordered.highinfo, 
            mod.sen.val.2.ordered.highinfo, 
            mod.sen.val.3.ordered.highinfo, 
            mod.sen.val.4.ordered.highinfo, 
            mod.sen.val.5.ordered.highinfo), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Senator Openness", "Senator Conscientiousness", 
                             "Senator Extraversion", "Senator Agreeableness", 
                             "Senator Emotional Stability", 
                             "Cutpoint 1", "Cutpoint 2", "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", "Respondent Ideological Extremity",
                             "Senator Openness $\\times$ Respondent Ideology",
                             "Senator Conscientiousness $\\times$ Respondent Ideology",
                             "Senator Extraversion $\\times$ Respondent Ideology",
                             "Senator Agreeableness $\\times$ Respondent Ideology",
                             "Senator Emotional Stability $\\times$ Respondent Ideology",
                             "Senator Openness $\\times$ Respondent Ideological Extremity",
                             "Senator Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Senator Extraversion $\\times$ Respondent Ideological Extremity",
                             "Senator Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Senator Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", "Income Refused", 
                             "Employed Full-Time", "Employed Part-Time", "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.sen.val.1.ordered.highinfo)$ST))), 3),
      round(t(t(unlist(summary(mod.sen.val.2.ordered.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.val.3.ordered.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.val.4.ordered.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.val.5.ordered.highinfo)$ST))), 3))


### Table C-1
texreg(file = "Table C-1.tex",
       list(mod.obama.val.1.ordered, 
            mod.obama.val.2.ordered, 
            mod.obama.val.3.ordered, 
            mod.obama.val.4.ordered, 
            mod.obama.val.5.ordered), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Obama Openness", "Obama Conscientiousness", 
                             "Obama Extraversion", "Obama Agreeableness", 
                             "Obama Emotional Stability", 
                             "Cutpoint 1", "Cutpoint 2", "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", "Respondent Ideological Extremity",
                             "Obama Openness $\\times$ Respondent Ideology",
                             "Obama Conscientiousness $\\times$ Respondent Ideology",
                             "Obama Extraversion $\\times$ Respondent Ideology",
                             "Obama Agreeableness $\\times$ Respondent Ideology",
                             "Obama Emotional Stability $\\times$ Respondent Ideology",
                             "Obama Openness $\\times$ Respondent Ideological Extremity",
                             "Obama Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Obama Extraversion $\\times$ Respondent Ideological Extremity",
                             "Obama Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Obama Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", "Income Refused", 
                             "Employed Full-Time", "Employed Part-Time", "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.obama.val.1.ordered)$ST))), 3),
      round(t(t(unlist(summary(mod.obama.val.2.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.obama.val.3.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.obama.val.4.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.obama.val.5.ordered)$ST))), 3))


### Table D-1
texreg(file = "Table D-1.tex",
       list(mod.sen2.val.1.ordered, 
            mod.sen2.val.2.ordered, 
            mod.sen2.val.3.ordered, 
            mod.sen2.val.4.ordered, 
            mod.sen2.val.5.ordered), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Senator Openness", "Senator Conscientiousness", 
                             "Senator Extraversion", "Senator Agreeableness", 
                             "Senator Emotional Stability", 
                             "Cutpoint 1", "Cutpoint 2", "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", "Respondent Ideological Extremity",
                             "Senator Openness $\\times$ Respondent Ideology",
                             "Senator Conscientiousness $\\times$ Respondent Ideology",
                             "Senator Extraversion $\\times$ Respondent Ideology",
                             "Senator Agreeableness $\\times$ Respondent Ideology",
                             "Senator Emotional Stability $\\times$ Respondent Ideology",
                             "Senator Openness $\\times$ Respondent Ideological Extremity",
                             "Senator Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Senator Extraversion $\\times$ Respondent Ideological Extremity",
                             "Senator Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Senator Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", "Income Refused", 
                             "Employed Full-Time", "Employed Part-Time", "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.sen2.val.1.ordered)$ST))), 3),
      round(t(t(unlist(summary(mod.sen2.val.2.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen2.val.3.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen2.val.4.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen2.val.5.ordered)$ST))), 3))


### Table A-4
texreg(file = "Table A-4.tex",
       list(mod.all.con.1.ordered, 
            mod.all.con.2.ordered, 
            mod.all.con.3.ordered, 
            mod.all.con.4.ordered, 
            mod.all.con.5.ordered), 
            stars = c(0.01, 0.05, 0.1), digits = 3,
            custom.coef.names = c("Openness Divergence", 
                                  "Conscientiousness Divergence", 
                                  "Extraversion Divergence", 
                                  "Agreeableness Divergence", 
                                  "Emotional Stability Divergence", 
                                  "Cutpoint 1", 
                                  "Cutpoint 2", 
                                  "Cutpoint 3",
                                  "Ideological Divergence", 
                                  "Respondent Ideology", 
                                  "Respondent Ideological Extremity",
                                  "Openness Divergence $\\times$ Respondent Ideology",
                                  "Conscientiousness Divergence $\\times$ Respondent Ideology",
                                  "Extraversion Divergence $\\times$ Respondent Ideology",
                                  "Agreeableness Divergence $\\times$ Respondent Ideology",
                                  "Emotional Stability Divergence $\\times$ Respondent Ideology",
                                  "Openness Divergence $\\times$ Respondent Ideological Extremity",
                                  "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                                  "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                                  "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                                  "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                                  "Political Information", 
                                  "Female", "Age", 
                                  "Education (1 = No HS; 6 = Postgrad)", 
                                  "Black", "Hispanic", "Other Race",
                                  "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                                  "Income Refused", 
                                  "Employed Full-Time", 
                                  "Employed Part-Time", 
                                  "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.all.con.1.ordered)$ST))), 3),
      round(t(t(unlist(summary(mod.all.con.2.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.con.3.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.con.4.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.con.5.ordered)$ST))), 3))


### Table E-4
texreg(file = "Table E-4.tex",
       list(mod.all.con.1.ordered.copartisan, 
            mod.all.con.2.ordered.copartisan, 
            mod.all.con.3.ordered.copartisan, 
            mod.all.con.4.ordered.copartisan, 
            mod.all.con.5.ordered.copartisan), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Openness Divergence", 
                             "Conscientiousness Divergence", 
                             "Extraversion Divergence", 
                             "Agreeableness Divergence", 
                             "Emotional Stability Divergence", 
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Openness Divergence $\\times$ Respondent Ideology",
                             "Conscientiousness Divergence $\\times$ Respondent Ideology",
                             "Extraversion Divergence $\\times$ Respondent Ideology",
                             "Agreeableness Divergence $\\times$ Respondent Ideology",
                             "Emotional Stability Divergence $\\times$ Respondent Ideology",
                             "Openness Divergence $\\times$ Respondent Ideological Extremity",
                             "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                             "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                             "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                             "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.all.con.1.ordered.copartisan)$ST))), 3),
      round(t(t(unlist(summary(mod.all.con.2.ordered.copartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.con.3.ordered.copartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.con.4.ordered.copartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.con.5.ordered.copartisan)$ST))), 3))


### Table F-4
texreg(file = "Table F-4.tex",
       list(mod.all.con.1.ordered.nopartisan, 
            mod.all.con.2.ordered.nopartisan, 
            mod.all.con.3.ordered.nopartisan, 
            mod.all.con.4.ordered.nopartisan, 
            mod.all.con.5.ordered.nopartisan), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Openness Divergence", 
                             "Conscientiousness Divergence", 
                             "Extraversion Divergence", 
                             "Agreeableness Divergence", 
                             "Emotional Stability Divergence", 
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Openness Divergence $\\times$ Respondent Ideology",
                             "Conscientiousness Divergence $\\times$ Respondent Ideology",
                             "Extraversion Divergence $\\times$ Respondent Ideology",
                             "Agreeableness Divergence $\\times$ Respondent Ideology",
                             "Emotional Stability Divergence $\\times$ Respondent Ideology",
                             "Openness Divergence $\\times$ Respondent Ideological Extremity",
                             "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                             "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                             "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                             "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.all.con.1.ordered.nonpartisan)$ST))), 3),
      round(t(t(unlist(summary(mod.all.con.2.ordered.nonpartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.con.3.ordered.nonpartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.con.4.ordered.nonpartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.con.5.ordered.nonpartisan)$ST))), 3))


### Table G-4
texreg(file = "Table G-4.tex",
       list(mod.all.con.1.ordered.lowinfo, 
            mod.all.con.2.ordered.lowinfo, 
            mod.all.con.3.ordered.lowinfo, 
            mod.all.con.4.ordered.lowinfo, 
            mod.all.con.5.ordered.lowinfo), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Openness Divergence", 
                             "Conscientiousness Divergence", 
                             "Extraversion Divergence", 
                             "Agreeableness Divergence", 
                             "Emotional Stability Divergence", 
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Openness Divergence $\\times$ Respondent Ideology",
                             "Conscientiousness Divergence $\\times$ Respondent Ideology",
                             "Extraversion Divergence $\\times$ Respondent Ideology",
                             "Agreeableness Divergence $\\times$ Respondent Ideology",
                             "Emotional Stability Divergence $\\times$ Respondent Ideology",
                             "Openness Divergence $\\times$ Respondent Ideological Extremity",
                             "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                             "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                             "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                             "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.all.con.1.ordered.lowinfo)$ST))), 3),
      round(t(t(unlist(summary(mod.all.con.2.ordered.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.con.3.ordered.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.con.4.ordered.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.con.5.ordered.lowinfo)$ST))), 3))


### Table H-4
texreg(file = "Table H-4.tex",
       list(mod.all.con.1.ordered.highinfo, 
            mod.all.con.2.ordered.highinfo, 
            mod.all.con.3.ordered.highinfo, 
            mod.all.con.4.ordered.highinfo, 
            mod.all.con.5.ordered.highinfo), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Openness Divergence", 
                             "Conscientiousness Divergence", 
                             "Extraversion Divergence", 
                             "Agreeableness Divergence", 
                             "Emotional Stability Divergence", 
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Openness Divergence $\\times$ Respondent Ideology",
                             "Conscientiousness Divergence $\\times$ Respondent Ideology",
                             "Extraversion Divergence $\\times$ Respondent Ideology",
                             "Agreeableness Divergence $\\times$ Respondent Ideology",
                             "Emotional Stability Divergence $\\times$ Respondent Ideology",
                             "Openness Divergence $\\times$ Respondent Ideological Extremity",
                             "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                             "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                             "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                             "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.all.con.1.ordered.highinfo)$ST))), 3),
      round(t(t(unlist(summary(mod.all.con.2.ordered.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.con.3.ordered.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.con.4.ordered.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.all.con.5.ordered.highinfo)$ST))), 3))


### Table A-5
texreg(file = "Table A-5.tex",
       list(mod.rep.con.1.ordered, 
            mod.rep.con.2.ordered, 
            mod.rep.con.3.ordered, 
            mod.rep.con.4.ordered, 
            mod.rep.con.5.ordered), 
            stars = c(0.01, 0.05, 0.1), digits = 3,
            custom.coef.names = c("Openness Divergence", 
                                  "Conscientiousness Divergence", 
                                  "Extraversion Divergence", 
                                  "Agreeableness Divergence", 
                                  "Emotional Stability Divergence", 
                                  "Cutpoint 1", 
                                  "Cutpoint 2", 
                                  "Cutpoint 3",
                                  "Ideological Divergence", 
                                  "Respondent Ideology", 
                                  "Respondent Ideological Extremity",
                                  "Openness Divergence $\\times$ Respondent Ideology",
                                  "Conscientiousness Divergence $\\times$ Respondent Ideology",
                                  "Extraversion Divergence $\\times$ Respondent Ideology",
                                  "Agreeableness Divergence $\\times$ Respondent Ideology",
                                  "Emotional Stability Divergence $\\times$ Respondent Ideology",
                                  "Openness Divergence $\\times$ Respondent Ideological Extremity",
                                  "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                                  "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                                  "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                                  "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                                  "Political Information", 
                                  "Female", "Age", 
                                  "Education (1 = No HS; 6 = Postgrad)", 
                                  "Black", "Hispanic", "Other Race",
                                  "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                                  "Income Refused", 
                                  "Employed Full-Time", 
                                  "Employed Part-Time", 
                                  "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.rep.con.1.ordered)$ST))), 3),
      round(t(t(unlist(summary(mod.rep.con.2.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.con.3.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.con.4.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.con.5.ordered)$ST))), 3))


### Table E-5
texreg(file = "Table E-5.tex",
       list(mod.rep.con.1.ordered.copartisan, 
            mod.rep.con.2.ordered.copartisan, 
            mod.rep.con.3.ordered.copartisan, 
            mod.rep.con.4.ordered.copartisan, 
            mod.rep.con.5.ordered.copartisan), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Openness Divergence", 
                             "Conscientiousness Divergence", 
                             "Extraversion Divergence", 
                             "Agreeableness Divergence", 
                             "Emotional Stability Divergence", 
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Openness Divergence $\\times$ Respondent Ideology",
                             "Conscientiousness Divergence $\\times$ Respondent Ideology",
                             "Extraversion Divergence $\\times$ Respondent Ideology",
                             "Agreeableness Divergence $\\times$ Respondent Ideology",
                             "Emotional Stability Divergence $\\times$ Respondent Ideology",
                             "Openness Divergence $\\times$ Respondent Ideological Extremity",
                             "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                             "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                             "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                             "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.rep.con.1.ordered.copartisan)$ST))), 3),
      round(t(t(unlist(summary(mod.rep.con.2.ordered.copartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.con.3.ordered.copartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.con.4.ordered.copartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.con.5.ordered.copartisan)$ST))), 3))


### Table F-5
texreg(file = "Table F-5.tex",
       list(mod.rep.con.1.ordered.nopartisan, 
            mod.rep.con.2.ordered.nopartisan, 
            mod.rep.con.3.ordered.nopartisan, 
            mod.rep.con.4.ordered.nopartisan, 
            mod.rep.con.5.ordered.nopartisan), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Openness Divergence", 
                             "Conscientiousness Divergence", 
                             "Extraversion Divergence", 
                             "Agreeableness Divergence", 
                             "Emotional Stability Divergence", 
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Openness Divergence $\\times$ Respondent Ideology",
                             "Conscientiousness Divergence $\\times$ Respondent Ideology",
                             "Extraversion Divergence $\\times$ Respondent Ideology",
                             "Agreeableness Divergence $\\times$ Respondent Ideology",
                             "Emotional Stability Divergence $\\times$ Respondent Ideology",
                             "Openness Divergence $\\times$ Respondent Ideological Extremity",
                             "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                             "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                             "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                             "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.rep.con.1.ordered.nopartisan)$ST))), 3),
      round(t(t(unlist(summary(mod.rep.con.2.ordered.nopartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.con.3.ordered.nopartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.con.4.ordered.nopartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.con.5.ordered.nopartisan)$ST))), 3))


### Table G-5
texreg(file = "Table G-5.tex",
       list(mod.rep.con.1.ordered.lowinfo, 
            mod.rep.con.2.ordered.lowinfo, 
            mod.rep.con.3.ordered.lowinfo, 
            mod.rep.con.4.ordered.lowinfo, 
            mod.rep.con.5.ordered.lowinfo), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Openness Divergence",
                             "Conscientiousness Divergence", 
                             "Extraversion Divergence", 
                             "Agreeableness Divergence", 
                             "Emotional Stability Divergence", 
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Openness Divergence $\\times$ Respondent Ideology",
                             "Conscientiousness Divergence $\\times$ Respondent Ideology",
                             "Extraversion Divergence $\\times$ Respondent Ideology",
                             "Agreeableness Divergence $\\times$ Respondent Ideology",
                             "Emotional Stability Divergence $\\times$ Respondent Ideology",
                             "Openness Divergence $\\times$ Respondent Ideological Extremity",
                             "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                             "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                             "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                             "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.rep.con.1.ordered.lowinfo)$ST))), 3),
      round(t(t(unlist(summary(mod.rep.con.2.ordered.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.con.3.ordered.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.con.4.ordered.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.con.5.ordered.lowinfo)$ST))), 3))


### Table H-5
texreg(file = "Table H-5.tex",
       list(mod.rep.con.1.ordered.highinfo, 
            mod.rep.con.2.ordered.highinfo, 
            mod.rep.con.3.ordered.highinfo, 
            mod.rep.con.4.ordered.highinfo, 
            mod.rep.con.5.ordered.highinfo), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Openness Divergence", 
                             "Conscientiousness Divergence", 
                             "Extraversion Divergence", 
                             "Agreeableness Divergence", 
                             "Emotional Stability Divergence", 
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Openness Divergence $\\times$ Respondent Ideology",
                             "Conscientiousness Divergence $\\times$ Respondent Ideology",
                             "Extraversion Divergence $\\times$ Respondent Ideology",
                             "Agreeableness Divergence $\\times$ Respondent Ideology",
                             "Emotional Stability Divergence $\\times$ Respondent Ideology",
                             "Openness Divergence $\\times$ Respondent Ideological Extremity",
                             "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                             "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                             "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                             "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.rep.con.1.ordered.highinfo)$ST))), 3),
      round(t(t(unlist(summary(mod.rep.con.2.ordered.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.con.3.ordered.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.con.4.ordered.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.rep.con.5.ordered.highinfo)$ST))), 3))


### Table A-6
texreg(file = "Table A-6.tex",
       list(mod.sen.con.1.ordered, 
            mod.sen.con.2.ordered, 
            mod.sen.con.3.ordered, 
            mod.sen.con.4.ordered, 
            mod.sen.con.5.ordered), 
            stars = c(0.01, 0.05, 0.1), digits = 3,
            custom.coef.names = c("Openness Divergence", 
                                  "Conscientiousness Divergence", 
                                  "Extraversion Divergence", 
                                  "Agreeableness Divergence", 
                                  "Emotional Stability Divergence", 
                                  "Cutpoint 1", 
                                  "Cutpoint 2", 
                                  "Cutpoint 3",
                                  "Ideological Divergence", 
                                  "Respondent Ideology", 
                                  "Respondent Ideological Extremity",
                                  "Openness Divergence $\\times$ Respondent Ideology",
                                  "Conscientiousness Divergence $\\times$ Respondent Ideology",
                                  "Extraversion Divergence $\\times$ Respondent Ideology",
                                  "Agreeableness Divergence $\\times$ Respondent Ideology",
                                  "Emotional Stability Divergence $\\times$ Respondent Ideology",
                                  "Openness Divergence $\\times$ Respondent Ideological Extremity",
                                  "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                                  "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                                  "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                                  "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                                  "Political Information", 
                                  "Female", "Age", 
                                  "Education (1 = No HS; 6 = Postgrad)", 
                                  "Black", "Hispanic", "Other Race",
                                  "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                                  "Income Refused", 
                                  "Employed Full-Time", 
                                  "Employed Part-Time", 
                                  "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.sen.con.1.ordered)$ST))), 3),
      round(t(t(unlist(summary(mod.sen.con.2.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.con.3.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.con.4.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.con.5.ordered)$ST))), 3))


### Table E-6
texreg(file = "Table E-6.tex",
       list(mod.sen.con.1.ordered.copartisan, 
            mod.sen.con.2.ordered.copartisan, 
            mod.sen.con.3.ordered.copartisan, 
            mod.sen.con.4.ordered.copartisan, 
            mod.sen.con.5.ordered.copartisan), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Openness Divergence", 
                             "Conscientiousness Divergence", 
                             "Extraversion Divergence", 
                             "Agreeableness Divergence", 
                             "Emotional Stability Divergence", 
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Openness Divergence $\\times$ Respondent Ideology",
                             "Conscientiousness Divergence $\\times$ Respondent Ideology",
                             "Extraversion Divergence $\\times$ Respondent Ideology",
                             "Agreeableness Divergence $\\times$ Respondent Ideology",
                             "Emotional Stability Divergence $\\times$ Respondent Ideology",
                             "Openness Divergence $\\times$ Respondent Ideological Extremity",
                             "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                             "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                             "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                             "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.sen.con.1.ordered.copartisan)$ST))), 3),
      round(t(t(unlist(summary(mod.sen.con.2.ordered.copartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.con.3.ordered.copartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.con.4.ordered.copartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.con.5.ordered.copartisan)$ST))), 3))


### Table F-6
texreg(file = "Table F-6.tex",
       list(mod.sen.con.1.ordered.nopartisan, 
            mod.sen.con.2.ordered.nopartisan, 
            mod.sen.con.3.ordered.nopartisan, 
            mod.sen.con.4.ordered.nopartisan, 
            mod.sen.con.5.ordered.nopartisan), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Openness Divergence", 
                             "Conscientiousness Divergence", 
                             "Extraversion Divergence", 
                             "Agreeableness Divergence", 
                             "Emotional Stability Divergence", 
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Openness Divergence $\\times$ Respondent Ideology",
                             "Conscientiousness Divergence $\\times$ Respondent Ideology",
                             "Extraversion Divergence $\\times$ Respondent Ideology",
                             "Agreeableness Divergence $\\times$ Respondent Ideology",
                             "Emotional Stability Divergence $\\times$ Respondent Ideology",
                             "Openness Divergence $\\times$ Respondent Ideological Extremity",
                             "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                             "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                             "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                             "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.sen.con.1.ordered.nopartisan)$ST))), 3),
      round(t(t(unlist(summary(mod.sen.con.2.ordered.nopartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.con.3.ordered.nopartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.con.4.ordered.nopartisan)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.con.5.ordered.nopartisan)$ST))), 3))


### Table G-6
texreg(file = "Table G-6.tex",
       list(mod.sen.con.1.ordered.lowinfo, 
            mod.sen.con.2.ordered.lowinfo, 
            mod.sen.con.3.ordered.lowinfo, 
            mod.sen.con.4.ordered.lowinfo, 
            mod.sen.con.5.ordered.lowinfo), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Openness Divergence", 
                             "Conscientiousness Divergence", 
                             "Extraversion Divergence", 
                             "Agreeableness Divergence", 
                             "Emotional Stability Divergence", 
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Openness Divergence $\\times$ Respondent Ideology",
                             "Conscientiousness Divergence $\\times$ Respondent Ideology",
                             "Extraversion Divergence $\\times$ Respondent Ideology",
                             "Agreeableness Divergence $\\times$ Respondent Ideology",
                             "Emotional Stability Divergence $\\times$ Respondent Ideology",
                             "Openness Divergence $\\times$ Respondent Ideological Extremity",
                             "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                             "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                             "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                             "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.sen.con.1.ordered.lowinfo)$ST))), 3),
      round(t(t(unlist(summary(mod.sen.con.2.ordered.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.con.3.ordered.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.con.4.ordered.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.con.5.ordered.lowinfo)$ST))), 3))


### Table H-6
texreg(file = "Table H-6.tex",
       list(mod.sen.con.1.ordered.highinfo, 
            mod.sen.con.2.ordered.highinfo, 
            mod.sen.con.3.ordered.highinfo, 
            mod.sen.con.4.ordered.highinfo, 
            mod.sen.con.5.ordered.highinfo), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Openness Divergence", 
                             "Conscientiousness Divergence", 
                             "Extraversion Divergence", 
                             "Agreeableness Divergence", 
                             "Emotional Stability Divergence", 
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Openness Divergence $\\times$ Respondent Ideology",
                             "Conscientiousness Divergence $\\times$ Respondent Ideology",
                             "Extraversion Divergence $\\times$ Respondent Ideology",
                             "Agreeableness Divergence $\\times$ Respondent Ideology",
                             "Emotional Stability Divergence $\\times$ Respondent Ideology",
                             "Openness Divergence $\\times$ Respondent Ideological Extremity",
                             "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                             "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                             "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                             "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.sen.con.1.ordered.highinfo)$ST))), 3),
      round(t(t(unlist(summary(mod.sen.con.2.ordered.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.con.3.ordered.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.con.4.ordered.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen.con.5.ordered.highinfo)$ST))), 3))


### Table C-2
texreg(file = "Table C-2.tex",
       list(mod.obama.con.1.ordered, 
            mod.obama.con.2.ordered, 
            mod.obama.con.3.ordered, 
            mod.obama.con.4.ordered, 
            mod.obama.con.5.ordered), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Openness Divergence", 
                             "Conscientiousness Divergence", 
                             "Extraversion Divergence", 
                             "Agreeableness Divergence", 
                             "Emotional Stability Divergence", 
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Openness Divergence $\\times$ Respondent Ideology",
                             "Conscientiousness Divergence $\\times$ Respondent Ideology",
                             "Extraversion Divergence $\\times$ Respondent Ideology",
                             "Agreeableness Divergence $\\times$ Respondent Ideology",
                             "Emotional Stability Divergence $\\times$ Respondent Ideology",
                             "Openness Divergence $\\times$ Respondent Ideological Extremity",
                             "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                             "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                             "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                             "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.obama.con.1.ordered)$ST))), 3),
      round(t(t(unlist(summary(mod.obama.con.2.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.obama.con.3.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.obama.con.4.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.obama.con.5.ordered)$ST))), 3))


### Table D-2
texreg(file = "Table D-2.tex",
       list(mod.sen2.con.1.ordered, 
            mod.sen2.con.2.ordered, 
            mod.sen2.con.3.ordered, 
            mod.sen2.con.4.ordered, 
            mod.sen2.con.5.ordered), 
       stars = c(0.01, 0.05, 0.1), digits = 3,
       custom.coef.names = c("Openness Divergence", 
                             "Conscientiousness Divergence", 
                             "Extraversion Divergence", 
                             "Agreeableness Divergence", 
                             "Emotional Stability Divergence", 
                             "Cutpoint 1", 
                             "Cutpoint 2", 
                             "Cutpoint 3",
                             "Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Openness Divergence $\\times$ Respondent Ideology",
                             "Conscientiousness Divergence $\\times$ Respondent Ideology",
                             "Extraversion Divergence $\\times$ Respondent Ideology",
                             "Agreeableness Divergence $\\times$ Respondent Ideology",
                             "Emotional Stability Divergence $\\times$ Respondent Ideology",
                             "Openness Divergence $\\times$ Respondent Ideological Extremity",
                             "Conscientiousness Divergence $\\times$ Respondent Ideological Extremity",
                             "Extraversion Divergence $\\times$ Respondent Ideological Extremity",
                             "Agreeableness Divergence $\\times$ Respondent Ideological Extremity",
                             "Emotional Stability Divergence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired"))

cbind(round(t(t(unlist(summary(mod.sen2.con.1.ordered)$ST))), 3),
      round(t(t(unlist(summary(mod.sen2.con.2.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen2.con.3.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen2.con.4.ordered)$ST))), 3), 
      round(t(t(unlist(summary(mod.sen2.con.5.ordered)$ST))), 3))


### Table G-14
clarke.relative.lowinfo.1 <- manualclarke_clmm(relative.val.mod.1.lowinfo, relative.con.mod.1.lowinfo)                                  
vuong.relative.lowinfo.1 <- manualvuong_clmm(relative.val.mod.1.lowinfo, relative.con.mod.1.lowinfo) 
clarke.relative.lowinfo.2 <- manualclarke_clmm(relative.val.mod.2.lowinfo, relative.con.mod.2.lowinfo)                                  
vuong.relative.lowinfo.2 <- manualvuong_clmm(relative.val.mod.2.lowinfo, relative.con.mod.2.lowinfo) 
clarke.relative.lowinfo.3 <- manualclarke_clmm(relative.val.mod.3.lowinfo, relative.con.mod.3.lowinfo)                                  
vuong.relative.lowinfo.3 <- manualvuong_clmm(relative.val.mod.3.lowinfo, relative.con.mod.3.lowinfo) 
clarke.relative.lowinfo.4 <- manualclarke_clmm(relative.val.mod.4.lowinfo, relative.con.mod.4.lowinfo)                                  
vuong.relative.lowinfo.4 <- manualvuong_clmm(relative.val.mod.4.lowinfo, relative.con.mod.4.lowinfo) 
clarke.relative.lowinfo.5 <- manualclarke_clmm(relative.val.mod.5.lowinfo, relative.con.mod.5.lowinfo)                                  
vuong.relative.lowinfo.5 <- manualvuong_clmm(relative.val.mod.5.lowinfo, relative.con.mod.5.lowinfo) 


rel.tests.lowinfo.df <- rbind(data.frame(Controls = "None",
                                 Test = "Clarke",
                                 Statistic = clarke.relative.lowinfo.1$stat,
                                 pvalue = clarke.relative.lowinfo.1$p),
                      data.frame(Controls = "Ideology",
                                 Test = "Clarke",
                                 Statistic = clarke.relative.lowinfo.2$stat,
                                 pvalue = clarke.relative.lowinfo.2$p),
                      data.frame(Controls = "Ideology & Personality Interaction",
                                 Test = "Clarke",
                                 Statistic = clarke.relative.lowinfo.3$stat,
                                 pvalue = clarke.relative.lowinfo.3$p),
                      data.frame(Controls = "Ideology, Personality Interaction, and Info.",
                                 Test = "Clarke",
                                 Statistic = clarke.relative.lowinfo.4$stat,
                                 pvalue = clarke.relative.lowinfo.4$p),
                      data.frame(Controls = "All",
                                 Test = "Clarke",
                                 Statistic = clarke.relative.lowinfo.5$stat,
                                 pvalue = clarke.relative.lowinfo.5$p),
                      data.frame(Controls = "None",
                                 Test = "Vuong",
                                 Statistic = vuong.relative.lowinfo.1$stat,
                                 pvalue = vuong.relative.lowinfo.1$p),
                      data.frame(Controls = "Ideology",
                                 Test = "Vuong",
                                 Statistic = vuong.relative.lowinfo.2$stat,
                                 pvalue = vuong.relative.lowinfo.2$p),
                      data.frame(Controls = "Ideology & Personality Interaction",
                                 Test = "Vuong",
                                 Statistic = vuong.relative.lowinfo.3$stat,
                                 pvalue = vuong.relative.lowinfo.3$p),
                      data.frame(Controls = "Ideology, Personality Interaction, and Info.",
                                 Test = "Vuong",
                                 Statistic = vuong.relative.lowinfo.4$stat,
                                 pvalue = vuong.relative.lowinfo.4$p),
                      data.frame(Controls = "All",
                                 Test = "Vuong",
                                 Statistic = vuong.relative.lowinfo.5$stat,
                                 pvalue = vuong.relative.lowinfo.5$p))

print(xtable(digits = 3, rel.tests.lowinfo.df), file = "Table G-14.tex")



### Table H-14
clarke.relative.highinfo.1 <- manualclarke_clmm(relative.val.mod.1.highinfo, relative.con.mod.1.highinfo)                                  
vuong.relative.highinfo.1 <- manualvuong_clmm(relative.val.mod.1.highinfo, relative.con.mod.1.highinfo) 
clarke.relative.highinfo.2 <- manualclarke_clmm(relative.val.mod.2.highinfo, relative.con.mod.2.highinfo)                                  
vuong.relative.highinfo.2 <- manualvuong_clmm(relative.val.mod.2.highinfo, relative.con.mod.2.highinfo) 
clarke.relative.highinfo.3 <- manualclarke_clmm(relative.val.mod.3.highinfo, relative.con.mod.3.highinfo)                                  
vuong.relative.highinfo.3 <- manualvuong_clmm(relative.val.mod.3.highinfo, relative.con.mod.3.highinfo) 
clarke.relative.highinfo.4 <- manualclarke_clmm(relative.val.mod.4.highinfo, relative.con.mod.4.highinfo)                                  
vuong.relative.highinfo.4 <- manualvuong_clmm(relative.val.mod.4.highinfo, relative.con.mod.4.highinfo) 
clarke.relative.highinfo.5 <- manualclarke_clmm(relative.val.mod.5.highinfo, relative.con.mod.5.highinfo)                                  
vuong.relative.highinfo.5 <- manualvuong_clmm(relative.val.mod.5.highinfo, relative.con.mod.5.highinfo) 


rel.tests.highinfo.df <- rbind(data.frame(Controls = "None",
                                         Test = "Clarke",
                                         Statistic = clarke.relative.highinfo.1$stat,
                                         pvalue = clarke.relative.highinfo.1$p),
                              data.frame(Controls = "Ideology",
                                         Test = "Clarke",
                                         Statistic = clarke.relative.highinfo.2$stat,
                                         pvalue = clarke.relative.highinfo.2$p),
                              data.frame(Controls = "Ideology & Personality Interaction",
                                         Test = "Clarke",
                                         Statistic = clarke.relative.highinfo.3$stat,
                                         pvalue = clarke.relative.highinfo.3$p),
                              data.frame(Controls = "Ideology, Personality Interaction, and Info.",
                                         Test = "Clarke",
                                         Statistic = clarke.relative.highinfo.4$stat,
                                         pvalue = clarke.relative.highinfo.4$p),
                              data.frame(Controls = "All",
                                         Test = "Clarke",
                                         Statistic = clarke.relative.highinfo.5$stat,
                                         pvalue = clarke.relative.highinfo.5$p),
                              data.frame(Controls = "None",
                                         Test = "Vuong",
                                         Statistic = vuong.relative.highinfo.1$stat,
                                         pvalue = vuong.relative.highinfo.1$p),
                              data.frame(Controls = "Ideology",
                                         Test = "Vuong",
                                         Statistic = vuong.relative.highinfo.2$stat,
                                         pvalue = vuong.relative.highinfo.2$p),
                              data.frame(Controls = "Ideology & Personality Interaction",
                                         Test = "Vuong",
                                         Statistic = vuong.relative.highinfo.3$stat,
                                         pvalue = vuong.relative.highinfo.3$p),
                              data.frame(Controls = "Ideology, Personality Interaction, and Info.",
                                         Test = "Vuong",
                                         Statistic = vuong.relative.highinfo.4$stat,
                                         pvalue = vuong.relative.highinfo.4$p),
                              data.frame(Controls = "All",
                                         Test = "Vuong",
                                         Statistic = vuong.relative.highinfo.5$stat,
                                         pvalue = vuong.relative.highinfo.5$p))

print(xtable(digits = 3, rel.tests.highinfo.df), file = "Table H-14.tex")

# Table B-5
lmtest.relmod.1.add.con <- lmtest::lrtest(relative.val.mod.1, relative.big.mod.1)
lmtest.relmod.1.add.val <- lmtest::lrtest(relative.con.mod.1, relative.big.mod.1)
lmtest.relmod.2.add.con <- lmtest::lrtest(relative.val.mod.2, relative.big.mod.2)
lmtest.relmod.2.add.val <- lmtest::lrtest(relative.con.mod.2, relative.big.mod.2)
lmtest.relmod.3.add.con <- lmtest::lrtest(relative.val.mod.3, relative.big.mod.3)
lmtest.relmod.3.add.val <- lmtest::lrtest(relative.con.mod.3, relative.big.mod.3)
lmtest.relmod.4.add.con <- lmtest::lrtest(relative.val.mod.4, relative.big.mod.4)
lmtest.relmod.4.add.val <- lmtest::lrtest(relative.con.mod.4, relative.big.mod.4)
lmtest.relmod.5.add.con <- lmtest::lrtest(relative.val.mod.5, relative.big.mod.5)
lmtest.relmod.5.add.val <- lmtest::lrtest(relative.con.mod.5, relative.big.mod.5)

lmtest.relmod <- rbind(data.frame(Controls = "None",
                                          Model = "Congruence Added to Valence",
                                          Statistic = lmtest.relmod.1.add.con$Chisq[2],
                                          pvalue = lmtest.relmod.1.add.con$`Pr(>Chisq)`[2]),
                               data.frame(Controls = "None",
                                          Model = "Valence Added to Congruence",
                                          Statistic = lmtest.relmod.1.add.val$Chisq[2],
                                          pvalue = lmtest.relmod.1.add.val$`Pr(>Chisq)`[2]),
                               data.frame(Controls = "Ideology",
                                          Model = "Congruence Added to Valence",
                                          Statistic = lmtest.relmod.2.add.con$Chisq[2],
                                          pvalue = lmtest.relmod.2.add.con$`Pr(>Chisq)`[2]),
                               data.frame(Controls = "Ideology",
                                          Model = "Valence Added to Congruence",
                                          Statistic = lmtest.relmod.2.add.val$Chisq[2],
                                          pvalue = lmtest.relmod.2.add.val$`Pr(>Chisq)`[2]),
                               data.frame(Controls = "Ideology & Personality Interaction",
                                          Model = "Congruence Added to Valence",
                                          Statistic = lmtest.relmod.3.add.con$Chisq[2],
                                          pvalue = lmtest.relmod.3.add.con$`Pr(>Chisq)`[2]),
                               data.frame(Controls = "Ideology & Personality Interaction",
                                          Model = "Valence Added to Congruence",
                                          Statistic = lmtest.relmod.3.add.val$Chisq[2],
                                          pvalue = lmtest.relmod.3.add.val$`Pr(>Chisq)`[2]),
                               data.frame(Controls = "Ideology, Personality Interaction, and Info.",
                                          Model = "Congruence Added to Valence",
                                          Statistic = lmtest.relmod.4.add.con$Chisq[2],
                                          pvalue = lmtest.relmod.4.add.con$`Pr(>Chisq)`[2]),
                               data.frame(Controls = "Ideology, Personality Interaction, and Info.",
                                          Model = "Valence Added to Congruence",
                                          Statistic = lmtest.relmod.4.add.val$Chisq[2],
                                          pvalue = lmtest.relmod.4.add.val$`Pr(>Chisq)`[2]),
                               data.frame(Controls = "All",
                                          Model = "Congruence Added to Valence",
                                          Statistic = lmtest.relmod.5.add.con$Chisq[2],
                                          pvalue = lmtest.relmod.5.add.con$`Pr(>Chisq)`[2]),
                               data.frame(Controls = "All",
                                          Model = "Valence Added to Congruence",
                                          Statistic = lmtest.relmod.5.add.val$Chisq[2],
                                          pvalue = lmtest.relmod.5.add.val$`Pr(>Chisq)`[2]))

print(xtable(digits = 3, lmtest.relmod), file = "Table B-5.tex")


### Table G-16
lmtest.relmod.1.add.con.lowinfo <- lmtest::lrtest(relative.val.mod.1.lowinfo, relative.big.mod.1.lowinfo)
lmtest.relmod.1.add.val.lowinfo <- lmtest::lrtest(relative.con.mod.1.lowinfo, relative.big.mod.1.lowinfo)
lmtest.relmod.2.add.con.lowinfo <- lmtest::lrtest(relative.val.mod.2.lowinfo, relative.big.mod.2.lowinfo)
lmtest.relmod.2.add.val.lowinfo <- lmtest::lrtest(relative.con.mod.2.lowinfo, relative.big.mod.2.lowinfo)
lmtest.relmod.3.add.con.lowinfo <- lmtest::lrtest(relative.val.mod.3.lowinfo, relative.big.mod.3.lowinfo)
lmtest.relmod.3.add.val.lowinfo <- lmtest::lrtest(relative.con.mod.3.lowinfo, relative.big.mod.3.lowinfo)
lmtest.relmod.4.add.con.lowinfo <- lmtest::lrtest(relative.val.mod.4.lowinfo, relative.big.mod.4.lowinfo)
lmtest.relmod.4.add.val.lowinfo <- lmtest::lrtest(relative.con.mod.4.lowinfo, relative.big.mod.4.lowinfo)
lmtest.relmod.5.add.con.lowinfo <- lmtest::lrtest(relative.val.mod.5.lowinfo, relative.big.mod.5.lowinfo)
lmtest.relmod.5.add.val.lowinfo <- lmtest::lrtest(relative.con.mod.5.lowinfo, relative.big.mod.5.lowinfo)

lmtest.relmod.lowinfo <- rbind(data.frame(Controls = "None",
                                          Model = "Congruence Added to Valence",
                                          Statistic = lmtest.relmod.1.add.con.lowinfo$Chisq[2],
                                          pvalue = lmtest.relmod.1.add.con.lowinfo$`Pr(>Chisq)`[2]),
                               data.frame(Controls = "None",
                                          Model = "Valence Added to Congruence",
                                          Statistic = lmtest.relmod.1.add.val.lowinfo$Chisq[2],
                                          pvalue = lmtest.relmod.1.add.val.lowinfo$`Pr(>Chisq)`[2]),
                               data.frame(Controls = "Ideology",
                                          Model = "Congruence Added to Valence",
                                          Statistic = lmtest.relmod.2.add.con.lowinfo$Chisq[2],
                                          pvalue = lmtest.relmod.2.add.con.lowinfo$`Pr(>Chisq)`[2]),
                               data.frame(Controls = "Ideology",
                                          Model = "Valence Added to Congruence",
                                          Statistic = lmtest.relmod.2.add.val.lowinfo$Chisq[2],
                                          pvalue = lmtest.relmod.2.add.val.lowinfo$`Pr(>Chisq)`[2]),
                               data.frame(Controls = "Ideology & Personality Interaction",
                                          Model = "Congruence Added to Valence",
                                          Statistic = lmtest.relmod.3.add.con.lowinfo$Chisq[2],
                                          pvalue = lmtest.relmod.3.add.con.lowinfo$`Pr(>Chisq)`[2]),
                               data.frame(Controls = "Ideology & Personality Interaction",
                                          Model = "Valence Added to Congruence",
                                          Statistic = lmtest.relmod.3.add.val.lowinfo$Chisq[2],
                                          pvalue = lmtest.relmod.3.add.val.lowinfo$`Pr(>Chisq)`[2]),
                               data.frame(Controls = "Ideology, Personality Interaction, and Info.",
                                          Model = "Congruence Added to Valence",
                                          Statistic = lmtest.relmod.4.add.con.lowinfo$Chisq[2],
                                          pvalue = lmtest.relmod.4.add.con.lowinfo$`Pr(>Chisq)`[2]),
                               data.frame(Controls = "Ideology, Personality Interaction, and Info.",
                                          Model = "Valence Added to Congruence",
                                          Statistic = lmtest.relmod.4.add.val.lowinfo$Chisq[2],
                                          pvalue = lmtest.relmod.4.add.val.lowinfo$`Pr(>Chisq)`[2]),
                               data.frame(Controls = "All",
                                          Model = "Congruence Added to Valence",
                                          Statistic = lmtest.relmod.5.add.con.lowinfo$Chisq[2],
                                          pvalue = lmtest.relmod.5.add.con.lowinfo$`Pr(>Chisq)`[2]),
                               data.frame(Controls = "All",
                                          Model = "Valence Added to Congruence",
                                          Statistic = lmtest.relmod.5.add.val.lowinfo$Chisq[2],
                                          pvalue = lmtest.relmod.5.add.val.lowinfo$`Pr(>Chisq)`[2]))

print(xtable(digits = 3, lmtest.relmod.lowinfo), file = "Table G-16.tex")

### Table H-16
lmtest.relmod.1.add.con.highinfo <- lmtest::lrtest(relative.val.mod.1.highinfo, relative.big.mod.1.highinfo)
lmtest.relmod.1.add.val.highinfo <- lmtest::lrtest(relative.con.mod.1.highinfo, relative.big.mod.1.highinfo)
lmtest.relmod.2.add.con.highinfo <- lmtest::lrtest(relative.val.mod.2.highinfo, relative.big.mod.2.highinfo)
lmtest.relmod.2.add.val.highinfo <- lmtest::lrtest(relative.con.mod.2.highinfo, relative.big.mod.2.highinfo)
lmtest.relmod.3.add.con.highinfo <- lmtest::lrtest(relative.val.mod.3.highinfo, relative.big.mod.3.highinfo)
lmtest.relmod.3.add.val.highinfo <- lmtest::lrtest(relative.con.mod.3.highinfo, relative.big.mod.3.highinfo)
lmtest.relmod.4.add.con.highinfo <- lmtest::lrtest(relative.val.mod.4.highinfo, relative.big.mod.4.highinfo)
lmtest.relmod.4.add.val.highinfo <- lmtest::lrtest(relative.con.mod.4.highinfo, relative.big.mod.4.highinfo)
lmtest.relmod.5.add.con.highinfo <- lmtest::lrtest(relative.val.mod.5.highinfo, relative.big.mod.5.highinfo)
lmtest.relmod.5.add.val.highinfo <- lmtest::lrtest(relative.con.mod.5.highinfo, relative.big.mod.5.highinfo)

lmtest.relmod.highinfo <- rbind(data.frame(Controls = "None",
                                          Model = "Congruence Added to Valence",
                                          Statistic = lmtest.relmod.1.add.con.highinfo$Chisq[2],
                                          pvalue = lmtest.relmod.1.add.con.highinfo$`Pr(>Chisq)`[2]),
                               data.frame(Controls = "None",
                                          Model = "Valence Added to Congruence",
                                          Statistic = lmtest.relmod.1.add.val.highinfo$Chisq[2],
                                          pvalue = lmtest.relmod.1.add.val.highinfo$`Pr(>Chisq)`[2]),
                               data.frame(Controls = "Ideology",
                                          Model = "Congruence Added to Valence",
                                          Statistic = lmtest.relmod.2.add.con.highinfo$Chisq[2],
                                          pvalue = lmtest.relmod.2.add.con.highinfo$`Pr(>Chisq)`[2]),
                               data.frame(Controls = "Ideology",
                                          Model = "Valence Added to Congruence",
                                          Statistic = lmtest.relmod.2.add.val.highinfo$Chisq[2],
                                          pvalue = lmtest.relmod.2.add.val.highinfo$`Pr(>Chisq)`[2]),
                               data.frame(Controls = "Ideology & Personality Interaction",
                                          Model = "Congruence Added to Valence",
                                          Statistic = lmtest.relmod.3.add.con.highinfo$Chisq[2],
                                          pvalue = lmtest.relmod.3.add.con.highinfo$`Pr(>Chisq)`[2]),
                               data.frame(Controls = "Ideology & Personality Interaction",
                                          Model = "Valence Added to Congruence",
                                          Statistic = lmtest.relmod.3.add.val.highinfo$Chisq[2],
                                          pvalue = lmtest.relmod.3.add.val.highinfo$`Pr(>Chisq)`[2]),
                               data.frame(Controls = "Ideology, Personality Interaction, and Info.",
                                          Model = "Congruence Added to Valence",
                                          Statistic = lmtest.relmod.4.add.con.highinfo$Chisq[2],
                                          pvalue = lmtest.relmod.4.add.con.highinfo$`Pr(>Chisq)`[2]),
                               data.frame(Controls = "Ideology, Personality Interaction, and Info.",
                                          Model = "Valence Added to Congruence",
                                          Statistic = lmtest.relmod.4.add.val.highinfo$Chisq[2],
                                          pvalue = lmtest.relmod.4.add.val.highinfo$`Pr(>Chisq)`[2]),
                               data.frame(Controls = "All",
                                          Model = "Congruence Added to Valence",
                                          Statistic = lmtest.relmod.5.add.con.highinfo$Chisq[2],
                                          pvalue = lmtest.relmod.5.add.con.highinfo$`Pr(>Chisq)`[2]),
                               data.frame(Controls = "All",
                                          Model = "Valence Added to Congruence",
                                          Statistic = lmtest.relmod.5.add.val.highinfo$Chisq[2],
                                          pvalue = lmtest.relmod.5.add.val.highinfo$`Pr(>Chisq)`[2]))

print(xtable(digits = 3, lmtest.relmod.highinfo), file = "Table H-16.tex")


### Table B-4
texreg(file = "Table B-4.tex",
       list(relative.big.mod.1, 
            relative.big.mod.2, 
            relative.big.mod.3, 
            relative.big.mod.4, 
            relative.big.mod.5), 
       digits = 3, stars = c(0.01, 0.05, 0.1),
       custom.coef.names = c("Relative Openness", 
                             "Relative Conscientiousness", 
                             "Relative Extraversion", 
                             "Relative Agreeableness", 
                             "Relative Emotional Stability", 
                             "Relative Openness Congruence", 
                             "Relative Conscientiousness Congruence", 
                             "Relative Extraversion Congruence", 
                             "Relative Agreeableness Congruence", 
                             "Relative Emotional Stability Congruence",
                             "Cutpoint 1", 
                             "Cutpoint 2",
                             "Relative Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Relative Openness $\\times$ Respondent Ideology",
                             "Relative Conscientiousness $\\times$ Respondent Ideology",
                             "Relative Extraversion $\\times$ Respondent Ideology",
                             "Relative Agreeableness $\\times$ Respondent Ideology",
                             "Relative Emotional Stability $\\times$ Respondent Ideology",
                             "Relative Openness Congruence $\\times$ Respondent Ideology",
                             "Relative Conscientiousness Congruence $\\times$ Respondent Ideology",
                             "Relative Extraversion Congruence $\\times$ Respondent Ideology",
                             "Relative Agreeableness Congruence $\\times$ Respondent Ideology",
                             "Relative Emotional Stability Congruence $\\times$ Respondent Ideology",
                             "Relative Openness $\\times$ Respondent Ideological Extremity",
                             "Relative Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Relative Extraversion $\\times$ Respondent Ideological Extremity",
                             "Relative Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Relative Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Relative Openness Congruence $\\times$ Respondent Ideological Extremity",
                             "Relative Conscientiousness Congruence $\\times$ Respondent Ideological Extremity",
                             "Relative Extraversion Congruence $\\times$ Respondent Ideological Extremity",
                             "Relative Agreeableness Congruence $\\times$ Respondent Ideological Extremity",
                             "Relative Emotional Stability Congruence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired", 
                             "Senator 1 Candidate", 
                             "Senator 2 Candidate"))

cbind(round(t(t(unlist(summary(relative.big.mod.1)$ST))), 3),
      round(t(t(unlist(summary(relative.big.mod.2)$ST))), 3), 
      round(t(t(unlist(summary(relative.big.mod.3)$ST))), 3), 
      round(t(t(unlist(summary(relative.big.mod.4)$ST))), 3), 
      round(t(t(unlist(summary(relative.big.mod.5)$ST))), 3))


### Table G-12
texreg(file = "Table G-12.tex",
       list(relative.big.mod.1.lowinfo, 
            relative.big.mod.2.lowinfo, 
            relative.big.mod.3.lowinfo, 
            relative.big.mod.4.lowinfo, 
            relative.big.mod.5.lowinfo), 
       digits = 3, stars = c(0.01, 0.05, 0.1),
       custom.coef.names = c("Relative Openness", 
                             "Relative Conscientiousness", 
                             "Relative Extraversion", 
                             "Relative Agreeableness", 
                             "Relative Emotional Stability", 
                             "Relative Openness Congruence", 
                             "Relative Conscientiousness Congruence", 
                             "Relative Extraversion Congruence", 
                             "Relative Agreeableness Congruence", 
                             "Relative Emotional Stability Congruence",
                             "Cutpoint 1", 
                             "Cutpoint 2",
                             "Relative Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Relative Openness $\\times$ Respondent Ideology",
                             "Relative Conscientiousness $\\times$ Respondent Ideology",
                             "Relative Extraversion $\\times$ Respondent Ideology",
                             "Relative Agreeableness $\\times$ Respondent Ideology",
                             "Relative Emotional Stability $\\times$ Respondent Ideology",
                             "Relative Openness Congruence $\\times$ Respondent Ideology",
                             "Relative Conscientiousness Congruence $\\times$ Respondent Ideology",
                             "Relative Extraversion Congruence $\\times$ Respondent Ideology",
                             "Relative Agreeableness Congruence $\\times$ Respondent Ideology",
                             "Relative Emotional Stability Congruence $\\times$ Respondent Ideology",
                             "Relative Openness $\\times$ Respondent Ideological Extremity",
                             "Relative Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Relative Extraversion $\\times$ Respondent Ideological Extremity",
                             "Relative Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Relative Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Relative Openness Congruence $\\times$ Respondent Ideological Extremity",
                             "Relative Conscientiousness Congruence $\\times$ Respondent Ideological Extremity",
                             "Relative Extraversion Congruence $\\times$ Respondent Ideological Extremity",
                             "Relative Agreeableness Congruence $\\times$ Respondent Ideological Extremity",
                             "Relative Emotional Stability Congruence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired", 
                             "Senator 1 Candidate", 
                             "Senator 2 Candidate"))

cbind(round(t(t(unlist(summary(relative.big.mod.1.lowinfo)$ST))), 3),
      round(t(t(unlist(summary(relative.big.mod.2.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(relative.big.mod.3.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(relative.big.mod.4.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(relative.big.mod.5.lowinfo)$ST))), 3))


### Table H-12
texreg(file = "Table H-12.tex",
       list(relative.big.mod.1.highinfo, 
            relative.big.mod.2.highinfo, 
            relative.big.mod.3.highinfo, 
            relative.big.mod.4.highinfo, 
            relative.big.mod.5.highinfo), 
       digits = 3, stars = c(0.01, 0.05, 0.1),
       custom.coef.names = c("Relative Openness", 
                             "Relative Conscientiousness", 
                             "Relative Extraversion", 
                             "Relative Agreeableness", 
                             "Relative Emotional Stability", 
                             "Relative Openness Congruence", 
                             "Relative Conscientiousness Congruence", 
                             "Relative Extraversion Congruence", 
                             "Relative Agreeableness Congruence", 
                             "Relative Emotional Stability Congruence",
                             "Cutpoint 1", 
                             "Cutpoint 2",
                             "Relative Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Relative Openness $\\times$ Respondent Ideology",
                             "Relative Conscientiousness $\\times$ Respondent Ideology",
                             "Relative Extraversion $\\times$ Respondent Ideology",
                             "Relative Agreeableness $\\times$ Respondent Ideology",
                             "Relative Emotional Stability $\\times$ Respondent Ideology",
                             "Relative Openness Congruence $\\times$ Respondent Ideology",
                             "Relative Conscientiousness Congruence $\\times$ Respondent Ideology",
                             "Relative Extraversion Congruence $\\times$ Respondent Ideology",
                             "Relative Agreeableness Congruence $\\times$ Respondent Ideology",
                             "Relative Emotional Stability Congruence $\\times$ Respondent Ideology",
                             "Relative Openness $\\times$ Respondent Ideological Extremity",
                             "Relative Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Relative Extraversion $\\times$ Respondent Ideological Extremity",
                             "Relative Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Relative Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Relative Openness Congruence $\\times$ Respondent Ideological Extremity",
                             "Relative Conscientiousness Congruence $\\times$ Respondent Ideological Extremity",
                             "Relative Extraversion Congruence $\\times$ Respondent Ideological Extremity",
                             "Relative Agreeableness Congruence $\\times$ Respondent Ideological Extremity",
                             "Relative Emotional Stability Congruence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired", 
                             "Senator 1 Candidate", 
                             "Senator 2 Candidate"))

cbind(round(t(t(unlist(summary(relative.big.mod.1.highinfo)$ST))), 3),
      round(t(t(unlist(summary(relative.big.mod.2.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(relative.big.mod.3.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(relative.big.mod.4.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(relative.big.mod.5.highinfo)$ST))), 3))


### Table A-7
texreg(file = "Table A-7.tex",
       list(relative.val.mod.1, 
            relative.val.mod.2, 
            relative.val.mod.3, 
            relative.val.mod.4, 
            relative.val.mod.5), 
       digits = 3, stars = c(0.01, 0.05, 0.1),
       custom.coef.names = c("Relative Openness", 
                             "Relative Conscientiousness", 
                             "Relative Extraversion", 
                             "Relative Agreeableness", 
                             "Relative Emotional Stability", 
                             "Cutpoint 1", 
                             "Cutpoint 2",
                             "Relative Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Relative Openness $\\times$ Respondent Ideology",
                             "Relative Conscientiousness $\\times$ Respondent Ideology",
                             "Relative Extraversion $\\times$ Respondent Ideology",
                             "Relative Agreeableness $\\times$ Respondent Ideology",
                             "Relative Emotional Stability $\\times$ Respondent Ideology",
                             "Relative Openness $\\times$ Respondent Ideological Extremity",
                             "Relative Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Relative Extraversion $\\times$ Respondent Ideological Extremity",
                             "Relative Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Relative Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired", 
                             "Senator 1 Candidate", 
                             "Senator 2 Candidate"))

cbind(round(t(t(unlist(summary(relative.val.mod.1)$ST))), 3),
      round(t(t(unlist(summary(relative.val.mod.2)$ST))), 3), 
      round(t(t(unlist(summary(relative.val.mod.3)$ST))), 3), 
      round(t(t(unlist(summary(relative.val.mod.4)$ST))), 3), 
      round(t(t(unlist(summary(relative.val.mod.5)$ST))), 3))


### Table G-10
texreg(file = "Table G-10.tex",
       list(relative.val.mod.1.lowinfo, 
            relative.val.mod.2.lowinfo, 
            relative.val.mod.3.lowinfo, 
            relative.val.mod.4.lowinfo, 
            relative.val.mod.5.lowinfo), 
       digits = 3, stars = c(0.01, 0.05, 0.1),
       custom.coef.names = c("Relative Openness", 
                             "Relative Conscientiousness", 
                             "Relative Extraversion", 
                             "Relative Agreeableness", 
                             "Relative Emotional Stability", 
                             "Cutpoint 1", 
                             "Cutpoint 2",
                             "Relative Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Relative Openness $\\times$ Respondent Ideology",
                             "Relative Conscientiousness $\\times$ Respondent Ideology",
                             "Relative Extraversion $\\times$ Respondent Ideology",
                             "Relative Agreeableness $\\times$ Respondent Ideology",
                             "Relative Emotional Stability $\\times$ Respondent Ideology",
                             "Relative Openness $\\times$ Respondent Ideological Extremity",
                             "Relative Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Relative Extraversion $\\times$ Respondent Ideological Extremity",
                             "Relative Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Relative Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired", 
                             "Senator 1 Candidate", 
                             "Senator 2 Candidate"))

cbind(round(t(t(unlist(summary(relative.val.mod.1.lowinfo)$ST))), 3),
      round(t(t(unlist(summary(relative.val.mod.2.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(relative.val.mod.3.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(relative.val.mod.4.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(relative.val.mod.5.lowinfo)$ST))), 3))


### Table H-10
texreg(file = "Table H-10.tex",
       list(relative.val.mod.1.highinfo, 
            relative.val.mod.2.highinfo, 
            relative.val.mod.3.highinfo, 
            relative.val.mod.4.highinfo, 
            relative.val.mod.5.highinfo), 
       digits = 3, stars = c(0.01, 0.05, 0.1),
       custom.coef.names = c("Relative Openness", 
                             "Relative Conscientiousness", 
                             "Relative Extraversion", 
                             "Relative Agreeableness", 
                             "Relative Emotional Stability", 
                             "Cutpoint 1", 
                             "Cutpoint 2",
                             "Relative Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Relative Openness $\\times$ Respondent Ideology",
                             "Relative Conscientiousness $\\times$ Respondent Ideology",
                             "Relative Extraversion $\\times$ Respondent Ideology",
                             "Relative Agreeableness $\\times$ Respondent Ideology",
                             "Relative Emotional Stability $\\times$ Respondent Ideology",
                             "Relative Openness $\\times$ Respondent Ideological Extremity",
                             "Relative Conscientiousness $\\times$ Respondent Ideological Extremity",
                             "Relative Extraversion $\\times$ Respondent Ideological Extremity",
                             "Relative Agreeableness $\\times$ Respondent Ideological Extremity",
                             "Relative Emotional Stability $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired", 
                             "Senator 1 Candidate", 
                             "Senator 2 Candidate"))

cbind(round(t(t(unlist(summary(relative.val.mod.1.highinfo)$ST))), 3),
      round(t(t(unlist(summary(relative.val.mod.2.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(relative.val.mod.3.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(relative.val.mod.4.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(relative.val.mod.5.highinfo)$ST))), 3))


### Table A-8
texreg(file = "Table A-8.tex",
       list(relative.con.mod.1, 
            relative.con.mod.2, 
            relative.con.mod.3, 
            relative.con.mod.4, 
            relative.con.mod.5), 
       digits = 3, stars = c(0.01, 0.05, 0.1),
       custom.coef.names = c("Relative Openness Congruence", 
                             "Relative Conscientiousness Congruence", 
                             "Relative Extraversion Congruence", 
                             "Relative Agreeableness Congruence", 
                             "Relative Emotional Stability Congruence", 
                             "Cutpoint 1", 
                             "Cutpoint 2",
                             "Relative Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Relative Openness Congruence $\\times$ Respondent Ideology",
                             "Relative Conscientiousness Congruence $\\times$ Respondent Ideology",
                             "Relative Extraversion Congruence $\\times$ Respondent Ideology",
                             "Relative Agreeableness Congruence $\\times$ Respondent Ideology",
                             "Relative Emotional Stability Congruence $\\times$ Respondent Ideology",
                             "Relative Openness Congruence $\\times$ Respondent Ideological Extremity",
                             "Relative Conscientiousness Congruence $\\times$ Respondent Ideological Extremity",
                             "Relative Extraversion Congruence $\\times$ Respondent Ideological Extremity",
                             "Relative Agreeableness Congruence $\\times$ Respondent Ideological Extremity",
                             "Relative Emotional Stability Congruence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", 
                             "Employed Part-Time", 
                             "Unemployed", "Retired", 
                             "Senator 1 Candidate", 
                             "Senator 2 Candidate"))

cbind(round(t(t(unlist(summary(relative.con.mod.1)$ST))), 3),
      round(t(t(unlist(summary(relative.con.mod.2)$ST))), 3), 
      round(t(t(unlist(summary(relative.con.mod.3)$ST))), 3), 
      round(t(t(unlist(summary(relative.con.mod.4)$ST))), 3), 
      round(t(t(unlist(summary(relative.con.mod.5)$ST))), 3))


# Table G-11
texreg(file = "Table G-11.tex",
       list(relative.con.mod.1.lowinfo, 
            relative.con.mod.2.lowinfo, 
            relative.con.mod.3.lowinfo, 
            relative.con.mod.4.lowinfo, 
            relative.con.mod.5.lowinfo), 
       digits = 3, stars = c(0.01, 0.05, 0.1),
       custom.coef.names = c("Relative Openness Congruence", 
                             "Relative Conscientiousness Congruence", 
                             "Relative Extraversion Congruence", 
                             "Relative Agreeableness Congruence", 
                             "Relative Emotional Stability Congruence", 
                             "Cutpoint 1", 
                             "Cutpoint 2",
                             "Relative Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Relative Openness Congruence $\\times$ Respondent Ideology",
                             "Relative Conscientiousness Congruence $\\times$ Respondent Ideology",
                             "Relative Extraversion Congruence $\\times$ Respondent Ideology",
                             "Relative Agreeableness Congruence $\\times$ Respondent Ideology",
                             "Relative Emotional Stability Congruence $\\times$ Respondent Ideology",
                             "Relative Openness Congruence $\\times$ Respondent Ideological Extremity",
                             "Relative Conscientiousness Congruence $\\times$ Respondent Ideological Extremity",
                             "Relative Extraversion Congruence $\\times$ Respondent Ideological Extremity",
                             "Relative Agreeableness Congruence $\\times$ Respondent Ideological Extremity",
                             "Relative Emotional Stability Congruence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", "Employed Part-Time", 
                             "Unemployed", "Retired", 
                             "Senator 1 Candidate", 
                             "Senator 2 Candidate"))

cbind(round(t(t(unlist(summary(relative.con.mod.1.lowinfo)$ST))), 3),
      round(t(t(unlist(summary(relative.con.mod.2.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(relative.con.mod.3.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(relative.con.mod.4.lowinfo)$ST))), 3), 
      round(t(t(unlist(summary(relative.con.mod.5.lowinfo)$ST))), 3))


# Table H-11
texreg(file = "Table H-11.tex",
       list(relative.con.mod.1.highinfo, 
            relative.con.mod.2.highinfo, 
            relative.con.mod.3.highinfo, 
            relative.con.mod.4.highinfo, 
            relative.con.mod.5.highinfo), 
       digits = 3, stars = c(0.01, 0.05, 0.1),
       custom.coef.names = c("Relative Openness Congruence", 
                             "Relative Conscientiousness Congruence", 
                             "Relative Extraversion Congruence", 
                             "Relative Agreeableness Congruence", 
                             "Relative Emotional Stability Congruence", 
                             "Cutpoint 1", 
                             "Cutpoint 2",
                             "Relative Ideological Divergence", 
                             "Respondent Ideology", 
                             "Respondent Ideological Extremity",
                             "Relative Openness Congruence $\\times$ Respondent Ideology",
                             "Relative Conscientiousness Congruence $\\times$ Respondent Ideology",
                             "Relative Extraversion Congruence $\\times$ Respondent Ideology",
                             "Relative Agreeableness Congruence $\\times$ Respondent Ideology",
                             "Relative Emotional Stability Congruence $\\times$ Respondent Ideology",
                             "Relative Openness Congruence $\\times$ Respondent Ideological Extremity",
                             "Relative Conscientiousness Congruence $\\times$ Respondent Ideological Extremity",
                             "Relative Extraversion Congruence $\\times$ Respondent Ideological Extremity",
                             "Relative Agreeableness Congruence $\\times$ Respondent Ideological Extremity",
                             "Relative Emotional Stability Congruence $\\times$ Respondent Ideological Extremity",
                             "Political Information", 
                             "Female", "Age", 
                             "Education (1 = No HS; 6 = Postgrad)", 
                             "Black", "Hispanic", "Other Race",
                             "Income (1 = <10k; 12 = >150k; 13 = Refused)", 
                             "Income Refused", 
                             "Employed Full-Time", "Employed Part-Time", 
                             "Unemployed", "Retired", 
                             "Senator 1 Candidate", 
                             "Senator 2 Candidate"))

cbind(round(t(t(unlist(summary(relative.con.mod.1.highinfo)$ST))), 3),
      round(t(t(unlist(summary(relative.con.mod.2.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(relative.con.mod.3.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(relative.con.mod.4.highinfo)$ST))), 3), 
      round(t(t(unlist(summary(relative.con.mod.5.highinfo)$ST))), 3))




### PLOTS

# SET PERSONALITY RANGE FOR PLOTTING
b5.range <- seq(1, 7, length.out = 101)
quantile.ordered <- function(x, probs = seq(0, 1, 0.25)) {
  tab <- table(x)
  cdf <- cumsum(tab / sum(tab))
  idx <- sapply(probs, function(p) min(which(cdf >= p)))
  levels(x)[idx] 
}

# Create mode function
Mode <- function(x) {
  ux <- unique(x)
  ux[which.max(tabulate(match(x, ux)))]
}


set.seed(1)
# marginalize over random effects
newcoefs <- rmvnorm(100000, mean = coef(mod.all.val.4.ordered), 
                            sigma = vcov(mod.all.val.4.ordered)[-grep("ST",colnames(vcov(mod.all.val.4.ordered))),
                                                                -grep("ST",colnames(vcov(mod.all.val.4.ordered)))])
colnames(newcoefs) <- rownames(data.frame(mod.all.val.4.ordered$coef))
                     

# write function to generate data frame and probabilities/marginal effects  
frame_gen_mfx <- function(trait, ideo, office){  
  set.seed(1)
  # marginalize over random effects
  newcoefs <- rmvnorm(100000, mean = coef(eval(parse(text = paste('mod.', office, 
                                                                  '.val.4.ordered', 
                                                                  sep = "")))), 
                              sigma = vcov(eval(parse(text = paste('mod.', office, 
                                                                   '.val.4.ordered', 
                                                                   sep = ""))))[-grep("ST",colnames(vcov(eval(parse(text = paste('mod.', office, '.val.4.ordered', sep = "")))))),
                                                                                -grep("ST",colnames(vcov(eval(parse(text = paste('mod.', office, '.val.4.ordered', sep = ""))))))])
  colnames(newcoefs) <- rownames(data.frame(mod.all.val.4.ordered$coef))
  trait <- grep(trait, c("openn", "consc", "extra", "agree", "emoti"), 
                ignore.case=TRUE, value=TRUE)
  office <- grep(office, c("all", "rep", "sen"), 
                 ignore.case = TRUE, value = TRUE)
  b5.foo <- seq(mean(unlist(eval(parse(text = paste('mod.', office, 
                                                    '.val.4.ordered$model', 
                                                    sep = "")))[paste('cong_', trait, sep="")])) - 
                  sd(unlist(eval(parse(text = paste('mod.', office, 
                                                    '.val.4.ordered$model', 
                                                    sep = "")))[paste('cong_', trait, sep="")])),
                mean(unlist(eval(parse(text = paste('mod.', office, 
                                                    '.val.4.ordered$model', 
                                                    sep = "")))[paste('cong_', trait, sep="")])) + 
                  sd(unlist(eval(parse(text = paste('mod.', office, 
                                                    '.val.4.ordered$model', 
                                                    sep = "")))[paste('cong_', trait, sep="")])),
                length.out = 2) 
  ideo <- grep(ideo, c("Liberal","Moderate","Conservative"), ignore.case=TRUE, value=TRUE)
  ideosign <- ((-1)*(ideo == "Liberal")) + ((0)*(ideo == "Moderate")) + ((1)*(ideo == "Conservative"))
  pred.frame <- data.frame(matrix(NA, 
                                  ncol = length(eval(parse(text = paste('mod.', office, 
                                                                        '.val.4.ordered$coef', 
                                                                        sep = "")))) - 3, 
                                  nrow = length(b5.foo)))
  colnames(pred.frame) <- rownames(data.frame(eval(parse(text = paste('mod.', office, 
                                                                      '.val.4.ordered$coef', 
                                                                      sep = "")))))[-c(1:3)]
  pred.frame['cong_openn'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', office, 
                                           '.val.4.ordered$model', 
                                           sep = "")))['cong_openn']))
  pred.frame['cong_consc'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', office, 
                                           '.val.4.ordered$model', 
                                           sep = "")))['cong_consc']))
  pred.frame['cong_extra'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', office, 
                                           '.val.4.ordered$model', 
                                           sep = "")))['cong_extra']))
  pred.frame['cong_agree'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', office, 
                                           '.val.4.ordered$model', 
                                           sep = "")))['cong_agree']))
  pred.frame['cong_emoti'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', office, 
                                           '.val.4.ordered$model', 
                                           sep = "")))['cong_emoti']))
  pred.frame['scaled_info'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', office, 
                                           '.val.4.ordered$model', 
                                           sep = "")))['scaled_info']))
  pred.frame[paste('cong_', trait, sep="")] <- b5.foo
  pred.frame['respondent_AM'] <- 
    0 + ideosign*sd(as.matrix(eval(parse(text = paste('mod.', office, 
                                                      '.val.4.ordered$model', 
                                                      sep = "")))['respondent_AM']))
  pred.frame['I(abs(respondent_AM))'] <- abs(pred.frame['respondent_AM'])
  pred.frame['I(abs(respondent_AM - cong_AM))'] <- 
    abs(pred.frame['respondent_AM'] - mean(cces.uber$cong_AM, na.rm = TRUE))
  pred.frame['respondent_AM:cong_openn'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_openn']
  pred.frame['respondent_AM:cong_consc'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_consc']
  pred.frame['respondent_AM:cong_extra'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_extra']
  pred.frame['respondent_AM:cong_agree'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_agree']
  pred.frame['respondent_AM:cong_emoti'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_emoti']
  pred.frame['I(abs(respondent_AM)):cong_openn'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_openn']
  pred.frame['I(abs(respondent_AM)):cong_consc'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_consc']
  pred.frame['I(abs(respondent_AM)):cong_extra'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_extra']
  pred.frame['I(abs(respondent_AM)):cong_agree'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_agree']
  pred.frame['I(abs(respondent_AM)):cong_emoti'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_emoti']
  
  # predicted probabilities, with random effects marginalized out
  pred.xb <- t(as.matrix(pred.frame)%*%t(newcoefs[,-c(1:3)]))
  pred.xb1 <- newcoefs[,1] - pred.xb
  pred.xb2 <- newcoefs[,2] - pred.xb
  pred.xb3 <- newcoefs[,3] - pred.xb        
  pred.p1 <- plogis(pred.xb1)
  pred.p2 <- plogis(pred.xb2) - plogis(pred.xb1)
  pred.p3 <- plogis(pred.xb3) - plogis(pred.xb2)
  pred.p4 <- 1 - plogis(pred.xb3)
  pred.probs <- data.frame(cbind(pred.p1[,2] - pred.p1[,1],
                                 pred.p2[,2] - pred.p2[,1],
                                 pred.p3[,2] - pred.p3[,1],
                                 pred.p4[,2] - pred.p4[,1]))
  pred.probs <- t(apply(pred.probs, 2,
                        quantile, 
                        c(0.05,0.5,0.95)))
  pred.probs <- data.frame(pred.probs,
                           trait,
                           ideo, 
                           office,
                           outcome = 1:4,
                           row.names = NULL)
  return(pred.probs)
}      

# copartisan function
frame_gen_mfx_copartisans <- function(trait, ideo, office){  
  set.seed(1)
  # marginalize over random effects
  newcoefs <- rmvnorm(100000, mean = coef(eval(parse(text = paste('mod.', office, 
                                                                  '.val.4.ordered.copartisan', 
                                                                  sep = "")))), 
                              sigma = vcov(eval(parse(text = paste('mod.', office, 
                                                                   '.val.4.ordered.copartisan', 
                                                                   sep = ""))))[-grep("ST",colnames(vcov(eval(parse(text = paste('mod.', office, '.val.4.ordered.copartisan', sep = "")))))),
                                                                                -grep("ST",colnames(vcov(eval(parse(text = paste('mod.', office, '.val.4.ordered.copartisan', sep = ""))))))])
  colnames(newcoefs) <- rownames(data.frame(mod.all.val.4.ordered.copartisan$coef))
  trait <- grep(trait, c("openn", "consc", "extra", "agree", "emoti"), 
                ignore.case=TRUE, value=TRUE)
  office <- grep(office, c("all", "rep", "sen"), 
                 ignore.case = TRUE, value = TRUE)
  b5.foo <- seq(mean(unlist(eval(parse(text = paste('mod.', office, 
                                                    '.val.4.ordered.copartisan$model', 
                                                    sep = "")))[paste('cong_', trait, sep="")])) - 
                  sd(unlist(eval(parse(text = paste('mod.', office, 
                                                    '.val.4.ordered.copartisan$model', 
                                                    sep = "")))[paste('cong_', trait, sep="")])),
                mean(unlist(eval(parse(text = paste('mod.', office, 
                                                    '.val.4.ordered.copartisan$model', 
                                                    sep = "")))[paste('cong_', trait, sep="")])) + 
                  sd(unlist(eval(parse(text = paste('mod.', office, 
                                                    '.val.4.ordered.copartisan$model', 
                                                    sep = "")))[paste('cong_', trait, sep="")])),
                length.out = 2) 
  ideo <- grep(ideo, c("Liberal","Moderate","Conservative"), ignore.case=TRUE, value=TRUE)
  ideosign <- ((-1)*(ideo == "Liberal")) + ((0)*(ideo == "Moderate")) + ((1)*(ideo == "Conservative"))
  pred.frame <- data.frame(matrix(NA, 
                                  ncol = length(eval(parse(text = paste('mod.', office, 
                                                                        '.val.4.ordered.copartisan$coef', 
                                                                        sep = "")))) - 3, 
                                  nrow = length(b5.foo)))
  colnames(pred.frame) <- rownames(data.frame(eval(parse(text = paste('mod.', office, 
                                                                      '.val.4.ordered.copartisan$coef', 
                                                                      sep = "")))))[-c(1:3)]
  pred.frame['cong_openn'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', office, 
                                           '.val.4.ordered.copartisan$model', 
                                           sep = "")))['cong_openn']))
  pred.frame['cong_consc'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', office, 
                                           '.val.4.ordered.copartisan$model', 
                                           sep = "")))['cong_consc']))
  pred.frame['cong_extra'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', office, 
                                           '.val.4.ordered.copartisan$model', 
                                           sep = "")))['cong_extra']))
  pred.frame['cong_agree'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', office, 
                                           '.val.4.ordered.copartisan$model', 
                                           sep = "")))['cong_agree']))
  pred.frame['cong_emoti'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', office, 
                                           '.val.4.ordered.copartisan$model', 
                                           sep = "")))['cong_emoti']))
  pred.frame['scaled_info'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', office, 
                                           '.val.4.ordered.copartisan$model', 
                                           sep = "")))['scaled_info']))
  pred.frame[paste('cong_', trait, sep="")] <- b5.foo
  pred.frame['respondent_AM'] <- 
    0 + ideosign*sd(as.matrix(eval(parse(text = paste('mod.', office, 
                                                      '.val.4.ordered.copartisan$model', 
                                                      sep = "")))['respondent_AM']))
  pred.frame['I(abs(respondent_AM))'] <- abs(pred.frame['respondent_AM'])
  pred.frame['I(abs(respondent_AM - cong_AM))'] <- 
    abs(pred.frame['respondent_AM'] - mean(cces.uber$cong_AM, na.rm = TRUE))
  pred.frame['respondent_AM:cong_openn'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_openn']
  pred.frame['respondent_AM:cong_consc'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_consc']
  pred.frame['respondent_AM:cong_extra'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_extra']
  pred.frame['respondent_AM:cong_agree'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_agree']
  pred.frame['respondent_AM:cong_emoti'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_emoti']
  pred.frame['I(abs(respondent_AM)):cong_openn'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_openn']
  pred.frame['I(abs(respondent_AM)):cong_consc'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_consc']
  pred.frame['I(abs(respondent_AM)):cong_extra'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_extra']
  pred.frame['I(abs(respondent_AM)):cong_agree'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_agree']
  pred.frame['I(abs(respondent_AM)):cong_emoti'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_emoti']
  
  # predicted probabilities, with random effects marginalized out
  pred.xb <- t(as.matrix(pred.frame)%*%t(newcoefs[,-c(1:3)]))
  pred.xb1 <- newcoefs[,1] - pred.xb
  pred.xb2 <- newcoefs[,2] - pred.xb
  pred.xb3 <- newcoefs[,3] - pred.xb        
  pred.p1 <- plogis(pred.xb1)
  pred.p2 <- plogis(pred.xb2) - plogis(pred.xb1)
  pred.p3 <- plogis(pred.xb3) - plogis(pred.xb2)
  pred.p4 <- 1 - plogis(pred.xb3)
  pred.probs <- data.frame(cbind(pred.p1[,2] - pred.p1[,1],
                                 pred.p2[,2] - pred.p2[,1],
                                 pred.p3[,2] - pred.p3[,1],
                                 pred.p4[,2] - pred.p4[,1]))
  pred.probs <- t(apply(pred.probs, 2,
                        quantile, 
                        c(0.05,0.5,0.95)))
  pred.probs <- data.frame(pred.probs,
                           trait,
                           ideo, 
                           office,
                           outcome = 1:4,
                           row.names = NULL)
  return(pred.probs)
}      

# outpartisan function
frame_gen_mfx_nopartisans <- function(trait, ideo, office){  
  set.seed(1)
  # remove random effects
  newcoefs <- rmvnorm(100000, mean = coef(eval(parse(text = paste('mod.', office, 
                                                                  '.val.4.ordered.nopartisan', 
                                                                  sep = "")))), 
                              sigma = vcov(eval(parse(text = paste('mod.', office, 
                                                                   '.val.4.ordered.nopartisan', 
                                                                   sep = ""))))[-grep("ST",colnames(vcov(eval(parse(text = paste('mod.', office, '.val.4.ordered.nopartisan', sep = "")))))),
                                                                                -grep("ST",colnames(vcov(eval(parse(text = paste('mod.', office, '.val.4.ordered.nopartisan', sep = ""))))))])
  colnames(newcoefs) <- rownames(data.frame(mod.all.val.4.ordered.nopartisan$coef))
  trait <- grep(trait, c("openn", "consc", "extra", "agree", "emoti"), 
                ignore.case=TRUE, value=TRUE)
  office <- grep(office, c("all", "rep", "sen"), 
                 ignore.case = TRUE, value = TRUE)
  b5.foo <- seq(mean(unlist(eval(parse(text = paste('mod.', office, 
                                                    '.val.4.ordered.nopartisan$model', 
                                                    sep = "")))[paste('cong_', trait, sep="")])) - 
                  sd(unlist(eval(parse(text = paste('mod.', office, 
                                                    '.val.4.ordered.nopartisan$model', 
                                                    sep = "")))[paste('cong_', trait, sep="")])),
                mean(unlist(eval(parse(text = paste('mod.', office, 
                                                    '.val.4.ordered.nopartisan$model', 
                                                    sep = "")))[paste('cong_', trait, sep="")])) + 
                  sd(unlist(eval(parse(text = paste('mod.', office, 
                                                    '.val.4.ordered.nopartisan$model', 
                                                    sep = "")))[paste('cong_', trait, sep="")])),
                length.out = 2) 
  ideo <- grep(ideo, c("Liberal","Moderate","Conservative"), ignore.case=TRUE, value=TRUE)
  ideosign <- ((-1)*(ideo == "Liberal")) + ((0)*(ideo == "Moderate")) + ((1)*(ideo == "Conservative"))
  pred.frame <- data.frame(matrix(NA, 
                                  ncol = length(eval(parse(text = paste('mod.', office, 
                                                                        '.val.4.ordered.nopartisan$coef', 
                                                                        sep = "")))) - 3, 
                                  nrow = length(b5.foo)))
  colnames(pred.frame) <- rownames(data.frame(eval(parse(text = paste('mod.', office, 
                                                                      '.val.4.ordered.nopartisan$coef', 
                                                                      sep = "")))))[-c(1:3)]
  pred.frame['cong_openn'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', office, 
                                           '.val.4.ordered.nopartisan$model', 
                                           sep = "")))['cong_openn']))
  pred.frame['cong_consc'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', office, 
                                           '.val.4.ordered.nopartisan$model', 
                                           sep = "")))['cong_consc']))
  pred.frame['cong_extra'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', office, 
                                           '.val.4.ordered.nopartisan$model', 
                                           sep = "")))['cong_extra']))
  pred.frame['cong_agree'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', office, 
                                           '.val.4.ordered.nopartisan$model', 
                                           sep = "")))['cong_agree']))
  pred.frame['cong_emoti'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', office, 
                                           '.val.4.ordered.nopartisan$model', 
                                           sep = "")))['cong_emoti']))
  pred.frame['scaled_info'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', office, 
                                           '.val.4.ordered.nopartisan$model', 
                                           sep = "")))['scaled_info']))
  pred.frame[paste('cong_', trait, sep="")] <- b5.foo
  pred.frame['respondent_AM'] <- 
    0 + ideosign*sd(as.matrix(eval(parse(text = paste('mod.', office, '.val.4.ordered.nopartisan$model', sep = "")))['respondent_AM']))
  pred.frame['I(abs(respondent_AM))'] <- abs(pred.frame['respondent_AM'])
  pred.frame['I(abs(respondent_AM - cong_AM))'] <- 
    abs(pred.frame['respondent_AM'] - mean(cces.uber$cong_AM, na.rm = TRUE))
  pred.frame['respondent_AM:cong_openn'] <- pred.frame['respondent_AM']*pred.frame['cong_openn']
  pred.frame['respondent_AM:cong_consc'] <- pred.frame['respondent_AM']*pred.frame['cong_consc']
  pred.frame['respondent_AM:cong_extra'] <- pred.frame['respondent_AM']*pred.frame['cong_extra']
  pred.frame['respondent_AM:cong_agree'] <- pred.frame['respondent_AM']*pred.frame['cong_agree']
  pred.frame['respondent_AM:cong_emoti'] <- pred.frame['respondent_AM']*pred.frame['cong_emoti']
  pred.frame['I(abs(respondent_AM)):cong_openn'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_openn']
  pred.frame['I(abs(respondent_AM)):cong_consc'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_consc']
  pred.frame['I(abs(respondent_AM)):cong_extra'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_extra']
  pred.frame['I(abs(respondent_AM)):cong_agree'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_agree']
  pred.frame['I(abs(respondent_AM)):cong_emoti'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_emoti']
  
  # predicted probabilities, with random effects marginalized out
  pred.xb <- t(as.matrix(pred.frame)%*%t(newcoefs[,-c(1:3)]))
  pred.xb1 <- newcoefs[,1] - pred.xb
  pred.xb2 <- newcoefs[,2] - pred.xb
  pred.xb3 <- newcoefs[,3] - pred.xb        
  pred.p1 <- plogis(pred.xb1)
  pred.p2 <- plogis(pred.xb2) - plogis(pred.xb1)
  pred.p3 <- plogis(pred.xb3) - plogis(pred.xb2)
  pred.p4 <- 1 - plogis(pred.xb3)
  pred.probs <- data.frame(cbind(pred.p1[,2] - pred.p1[,1],
                                 pred.p2[,2] - pred.p2[,1],
                                 pred.p3[,2] - pred.p3[,1],
                                 pred.p4[,2] - pred.p4[,1]))
  pred.probs <- t(apply(pred.probs, 2, 
                        quantile, 
                        c(0.05,0.5,0.95)))
  pred.probs <- data.frame(pred.probs,
                           trait,
                           ideo, 
                           office,
                           outcome = 1:4,
                           row.names = NULL)
  return(pred.probs)
}      

# outpartisan-representative function
frame_gen_mfx_nopartisans_rep <- function(trait, ideo, office){  
  set.seed(1)
  # remove random effects
  newcoefs <- rmvnorm(100000, mean = coef(eval(parse(text = paste('mod.', 
                                                                  office, 
                                                                  '.val.4.ordered.nopartisan', 
                                                                  sep = "")))), 
                              sigma = vcov(eval(parse(text = paste('mod.', 
                                                                   office, 
                                                                   '.val.4.ordered.nopartisan', 
                                                                   sep = "")))))
  colnames(newcoefs) <- rownames(data.frame(mod.all.val.4.ordered.nopartisan$coef))
  trait <- grep(trait, c("openn", "consc", "extra", "agree", "emoti"), 
                ignore.case=TRUE, value=TRUE)
  office <- grep(office, c("all", "rep", "sen"), 
                 ignore.case = TRUE, value = TRUE)
  b5.foo <- seq(mean(unlist(eval(parse(text = paste('mod.', 
                                                    office, 
                                                    '.val.4.ordered.nopartisan$model', 
                                                    sep = "")))[paste('cong_', trait, sep="")])) - 
                  sd(unlist(eval(parse(text = paste('mod.', 
                                                    office, 
                                                    '.val.4.ordered.nopartisan$model', 
                                                    sep = "")))[paste('cong_', trait, sep="")])),
                mean(unlist(eval(parse(text = paste('mod.', 
                                                    office, 
                                                    '.val.4.ordered.nopartisan$model', 
                                                    sep = "")))[paste('cong_', trait, sep="")])) + 
                  sd(unlist(eval(parse(text = paste('mod.', 
                                                    office, 
                                                    '.val.4.ordered.nopartisan$model', 
                                                    sep = "")))[paste('cong_', trait, sep="")])),
                length.out = 2) 
  ideo <- grep(ideo, c("Liberal","Moderate","Conservative"), ignore.case=TRUE, value=TRUE)
  ideosign <- ((-1)*(ideo == "Liberal")) + ((0)*(ideo == "Moderate")) + ((1)*(ideo == "Conservative"))
  pred.frame <- data.frame(matrix(NA, 
                                  ncol = length(eval(parse(text = paste('mod.', 
                                                                        office, 
                                                                        '.val.4.ordered.nopartisan$coef', 
                                                                        sep = "")))) - 3, 
                                  nrow = length(b5.foo)))
  colnames(pred.frame) <- rownames(data.frame(eval(parse(text = paste('mod.', 
                                                                      office, 
                                                                      '.val.4.ordered.nopartisan$coef', 
                                                                      sep = "")))))[-c(1:3)]
  pred.frame['cong_openn'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', 
                                           office, 
                                           '.val.4.ordered.nopartisan$model', 
                                           sep = "")))['cong_openn']))
  pred.frame['cong_consc'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', 
                                           office, 
                                           '.val.4.ordered.nopartisan$model', 
                                           sep = "")))['cong_consc']))
  pred.frame['cong_extra'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', 
                                           office, 
                                           '.val.4.ordered.nopartisan$model', 
                                           sep = "")))['cong_extra']))
  pred.frame['cong_agree'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', 
                                           office, 
                                           '.val.4.ordered.nopartisan$model', 
                                           sep = "")))['cong_agree']))
  pred.frame['cong_emoti'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', 
                                           office, 
                                           '.val.4.ordered.nopartisan$model', 
                                           sep = "")))['cong_emoti']))
  pred.frame['scaled_info'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', office, 
                                           '.val.4.ordered.nopartisan$model', 
                                           sep = "")))['scaled_info']))
  pred.frame[paste('cong_', trait, sep="")] <- b5.foo
  pred.frame['respondent_AM'] <- 
    0 + ideosign*sd(as.matrix(eval(parse(text = paste('mod.', office, 
                                                      '.val.4.ordered.nopartisan$model', 
                                                      sep = "")))['respondent_AM']))
  pred.frame['I(abs(respondent_AM))'] <- abs(pred.frame['respondent_AM'])
  pred.frame['I(abs(respondent_AM - cong_AM))'] <- 
    abs(pred.frame['respondent_AM'] - mean(cces.uber$cong_AM, na.rm = TRUE))
  pred.frame['respondent_AM:cong_openn'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_openn']
  pred.frame['respondent_AM:cong_consc'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_consc']
  pred.frame['respondent_AM:cong_extra'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_extra']
  pred.frame['respondent_AM:cong_agree'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_agree']
  pred.frame['respondent_AM:cong_emoti'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_emoti']
  pred.frame['I(abs(respondent_AM)):cong_openn'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_openn']
  pred.frame['I(abs(respondent_AM)):cong_consc'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_consc']
  pred.frame['I(abs(respondent_AM)):cong_extra'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_extra']
  pred.frame['I(abs(respondent_AM)):cong_agree'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_agree']
  pred.frame['I(abs(respondent_AM)):cong_emoti'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_emoti']
  
  # predicted probabilities, with random effects marginalized out
  pred.xb <- t(as.matrix(pred.frame)%*%t(newcoefs[,-c(1:3)]))
  pred.xb1 <- newcoefs[,1] - pred.xb
  pred.xb2 <- newcoefs[,2] - pred.xb
  pred.xb3 <- newcoefs[,3] - pred.xb        
  pred.p1 <- plogis(pred.xb1)
  pred.p2 <- plogis(pred.xb2) - plogis(pred.xb1)
  pred.p3 <- plogis(pred.xb3) - plogis(pred.xb2)
  pred.p4 <- 1 - plogis(pred.xb3)
  pred.probs <- data.frame(cbind(pred.p1[,2] - pred.p1[,1],
                                 pred.p2[,2] - pred.p2[,1],
                                 pred.p3[,2] - pred.p3[,1],
                                 pred.p4[,2] - pred.p4[,1]))
  pred.probs <- t(apply(pred.probs, 2, 
                        quantile, 
                        c(0.05,0.5,0.95)))
  pred.probs <- data.frame(pred.probs,
                           trait,
                           ideo, 
                           office,
                           outcome = 1:4,
                           row.names = NULL)
  return(pred.probs)
}      

# low-information function
frame_gen_mfx_lowinfo <- function(trait, ideo, office){  
  set.seed(1)
  # marginalize over random effects
  newcoefs <- rmvnorm(100000, mean = coef(eval(parse(text = paste('mod.', 
                                                                  office, 
                                                                  '.val.4.ordered.lowinfo', 
                                                                  sep = "")))), 
                              sigma = vcov(eval(parse(text = paste('mod.', 
                                                                   office, 
                                                                   '.val.4.ordered.lowinfo', 
                                                                   sep = ""))))[-grep("ST",colnames(vcov(eval(parse(text = paste('mod.', office, '.val.4.ordered.lowinfo', sep = "")))))),
                                                                                -grep("ST",colnames(vcov(eval(parse(text = paste('mod.', office, '.val.4.ordered.lowinfo', sep = ""))))))])
  colnames(newcoefs) <- rownames(data.frame(mod.all.val.4.ordered.lowinfo$coef))
  trait <- grep(trait, c("openn", "consc", "extra", "agree", "emoti"), 
                ignore.case=TRUE, value=TRUE)
  office <- grep(office, c("all", "rep", "sen"), 
                 ignore.case = TRUE, value = TRUE)
  b5.foo <- seq(mean(unlist(eval(parse(text = paste('mod.', 
                                                    office, 
                                                    '.val.4.ordered.lowinfo$model', 
                                                    sep = "")))[paste('cong_', trait, sep="")])) - 
                  sd(unlist(eval(parse(text = paste('mod.', 
                                                    office, 
                                                    '.val.4.ordered.lowinfo$model', 
                                                    sep = "")))[paste('cong_', trait, sep="")])),
                mean(unlist(eval(parse(text = paste('mod.', 
                                                    office, 
                                                    '.val.4.ordered.lowinfo$model', 
                                                    sep = "")))[paste('cong_', trait, sep="")])) + 
                  sd(unlist(eval(parse(text = paste('mod.', 
                                                    office, 
                                                    '.val.4.ordered.lowinfo$model', 
                                                    sep = "")))[paste('cong_', trait, sep="")])),
                length.out = 2) 
  ideo <- grep(ideo, c("Liberal","Moderate","Conservative"), 
               ignore.case=TRUE, value=TRUE)
  ideosign <- ((-1)*(ideo == "Liberal")) + ((0)*(ideo == "Moderate")) + ((1)*(ideo == "Conservative"))
  pred.frame <- data.frame(matrix(NA, 
                                  ncol = length(eval(parse(text = paste('mod.', 
                                                                        office, 
                                                                        '.val.4.ordered.lowinfo$coef', 
                                                                        sep = "")))) - 3, 
                                  nrow = length(b5.foo)))
  colnames(pred.frame) <- rownames(data.frame(eval(parse(text = paste('mod.', 
                                                                      office, 
                                                                      '.val.4.ordered.lowinfo$coef', 
                                                                      sep = "")))))[-c(1:3)]
  pred.frame['cong_openn'] <- mean(as.matrix(eval(parse(text = paste('mod.', 
                                                                     office, 
                                                                     '.val.4.ordered.lowinfo$model', 
                                                                     sep = "")))['cong_openn']))
  pred.frame['cong_consc'] <- mean(as.matrix(eval(parse(text = paste('mod.', 
                                                                     office, 
                                                                     '.val.4.ordered.lowinfo$model', 
                                                                     sep = "")))['cong_consc']))
  pred.frame['cong_extra'] <- mean(as.matrix(eval(parse(text = paste('mod.', 
                                                                     office, 
                                                                     '.val.4.ordered.lowinfo$model', 
                                                                     sep = "")))['cong_extra']))
  pred.frame['cong_agree'] <- mean(as.matrix(eval(parse(text = paste('mod.', 
                                                                     office, 
                                                                     '.val.4.ordered.lowinfo$model', 
                                                                     sep = "")))['cong_agree']))
  pred.frame['cong_emoti'] <- mean(as.matrix(eval(parse(text = paste('mod.', 
                                                                     office, 
                                                                     '.val.4.ordered.lowinfo$model', 
                                                                     sep = "")))['cong_emoti']))
  pred.frame['scaled_info'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', 
                                           office, 
                                           '.val.4.ordered.lowinfo$model', 
                                           sep = "")))['scaled_info']))
  pred.frame[paste('cong_', trait, sep="")] <- b5.foo
  pred.frame['respondent_AM'] <- 
    0 + ideosign*sd(as.matrix(eval(parse(text = paste('mod.', 
                                                      office, 
                                                      '.val.4.ordered.lowinfo$model', 
                                                      sep = "")))['respondent_AM']))
  pred.frame['I(abs(respondent_AM))'] <- abs(pred.frame['respondent_AM'])
  pred.frame['I(abs(respondent_AM - cong_AM))'] <- 
    abs(pred.frame['respondent_AM'] - mean(cces.uber$cong_AM, na.rm = TRUE))
  pred.frame['respondent_AM:cong_openn'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_openn']
  pred.frame['respondent_AM:cong_consc'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_consc']
  pred.frame['respondent_AM:cong_extra'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_extra']
  pred.frame['respondent_AM:cong_agree'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_agree']
  pred.frame['respondent_AM:cong_emoti'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_emoti']
  pred.frame['I(abs(respondent_AM)):cong_openn'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_openn']
  pred.frame['I(abs(respondent_AM)):cong_consc'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_consc']
  pred.frame['I(abs(respondent_AM)):cong_extra'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_extra']
  pred.frame['I(abs(respondent_AM)):cong_agree'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_agree']
  pred.frame['I(abs(respondent_AM)):cong_emoti'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_emoti']
  
  # predicted probabilities, with random effects marginalized out
  pred.xb <- t(as.matrix(pred.frame)%*%t(newcoefs[,-c(1:3)]))
  pred.xb1 <- newcoefs[,1] - pred.xb
  pred.xb2 <- newcoefs[,2] - pred.xb
  pred.xb3 <- newcoefs[,3] - pred.xb        
  pred.p1 <- plogis(pred.xb1)
  pred.p2 <- plogis(pred.xb2) - plogis(pred.xb1)
  pred.p3 <- plogis(pred.xb3) - plogis(pred.xb2)
  pred.p4 <- 1 - plogis(pred.xb3)
  pred.probs <- data.frame(cbind(pred.p1[,2] - pred.p1[,1],
                                 pred.p2[,2] - pred.p2[,1],
                                 pred.p3[,2] - pred.p3[,1],
                                 pred.p4[,2] - pred.p4[,1]))
  pred.probs <- t(apply(pred.probs, 2, 
                        quantile, 
                        c(0.05,0.5,0.95)))
  pred.probs <- data.frame(pred.probs,
                           trait,
                           ideo, 
                           office,
                           outcome = 1:4,
                           row.names = NULL)
  return(pred.probs)
}      

# low-information/republican function
frame_gen_mfx_lowinfo_rep <- function(trait, ideo, office){  
  set.seed(1)
  newcoefs <- rmvnorm(100000, mean = coef(eval(parse(text = paste('mod.', office, 
                                                                  '.val.4.ordered.lowinfo', 
                                                                  sep = "")))), 
                              sigma = vcov(eval(parse(text = paste('mod.', 
                                                                   office, 
                                                                   '.val.4.ordered.lowinfo', 
                                                                   sep = "")))))
  colnames(newcoefs) <- rownames(data.frame(mod.all.val.4.ordered.lowinfo$coef))
  trait <- grep(trait, c("openn", "consc", "extra", "agree", "emoti"), 
                ignore.case=TRUE, value=TRUE)
  office <- grep(office, c("all", "rep", "sen"), 
                 ignore.case = TRUE, value = TRUE)
  b5.foo <- seq(mean(unlist(eval(parse(text = paste('mod.', office, 
                                                    '.val.4.ordered.lowinfo$model', 
                                                    sep = "")))[paste('cong_', trait, sep="")])) - 
                  sd(unlist(eval(parse(text = paste('mod.', office, 
                                                    '.val.4.ordered.lowinfo$model', 
                                                    sep = "")))[paste('cong_', trait, sep="")])),
                mean(unlist(eval(parse(text = paste('mod.', office, 
                                                    '.val.4.ordered.lowinfo$model', 
                                                    sep = "")))[paste('cong_', trait, sep="")])) + 
                  sd(unlist(eval(parse(text = paste('mod.', office, 
                                                    '.val.4.ordered.lowinfo$model', 
                                                    sep = "")))[paste('cong_', trait, sep="")])),
                length.out = 2) 
  ideo <- grep(ideo, c("Liberal","Moderate","Conservative"), ignore.case=TRUE, value=TRUE)
  ideosign <- ((-1)*(ideo == "Liberal")) + ((0)*(ideo == "Moderate")) + ((1)*(ideo == "Conservative"))
  pred.frame <- data.frame(matrix(NA, 
                                  ncol = length(eval(parse(text = paste('mod.', 
                                                                        office, 
                                                                        '.val.4.ordered.lowinfo$coef', 
                                                                        sep = "")))) - 3, 
                                  nrow = length(b5.foo)))
  colnames(pred.frame) <- rownames(data.frame(eval(parse(text = paste('mod.', 
                                                                      office, 
                                                                      '.val.4.ordered.lowinfo$coef', 
                                                                      sep = "")))))[-c(1:3)]
  pred.frame['cong_openn'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', office, 
                                           '.val.4.ordered.lowinfo$model', 
                                           sep = "")))['cong_openn']))
  pred.frame['cong_consc'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', office, 
                                           '.val.4.ordered.lowinfo$model', 
                                           sep = "")))['cong_consc']))
  pred.frame['cong_extra'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', office, 
                                           '.val.4.ordered.lowinfo$model', 
                                           sep = "")))['cong_extra']))
  pred.frame['cong_agree'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', office, 
                                           '.val.4.ordered.lowinfo$model', 
                                           sep = "")))['cong_agree']))
  pred.frame['cong_emoti'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', office, 
                                           '.val.4.ordered.lowinfo$model', 
                                           sep = "")))['cong_emoti']))
  pred.frame['scaled_info'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', office, 
                                           '.val.4.ordered.lowinfo$model', 
                                           sep = "")))['scaled_info']))
  pred.frame[paste('cong_', trait, sep="")] <- b5.foo
  pred.frame['respondent_AM'] <- 
    0 + ideosign*sd(as.matrix(eval(parse(text = paste('mod.', office, 
                                                      '.val.4.ordered.lowinfo$model', 
                                                      sep = "")))['respondent_AM']))
  pred.frame['I(abs(respondent_AM))'] <- abs(pred.frame['respondent_AM'])
  pred.frame['I(abs(respondent_AM - cong_AM))'] <- 
    abs(pred.frame['respondent_AM'] - mean(cces.uber$cong_AM, na.rm = TRUE))
  pred.frame['respondent_AM:cong_openn'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_openn']
  pred.frame['respondent_AM:cong_consc'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_consc']
  pred.frame['respondent_AM:cong_extra'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_extra']
  pred.frame['respondent_AM:cong_agree'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_agree']
  pred.frame['respondent_AM:cong_emoti'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_emoti']
  pred.frame['I(abs(respondent_AM)):cong_openn'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_openn']
  pred.frame['I(abs(respondent_AM)):cong_consc'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_consc']
  pred.frame['I(abs(respondent_AM)):cong_extra'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_extra']
  pred.frame['I(abs(respondent_AM)):cong_agree'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_agree']
  pred.frame['I(abs(respondent_AM)):cong_emoti'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_emoti']
  
  # predicted probabilities, with random effects marginalized out
  pred.xb <- t(as.matrix(pred.frame)%*%t(newcoefs[,-c(1:3)]))
  pred.xb1 <- newcoefs[,1] - pred.xb
  pred.xb2 <- newcoefs[,2] - pred.xb
  pred.xb3 <- newcoefs[,3] - pred.xb        
  pred.p1 <- plogis(pred.xb1)
  pred.p2 <- plogis(pred.xb2) - plogis(pred.xb1)
  pred.p3 <- plogis(pred.xb3) - plogis(pred.xb2)
  pred.p4 <- 1 - plogis(pred.xb3)
  pred.probs <- data.frame(cbind(pred.p1[,2] - pred.p1[,1],
                                 pred.p2[,2] - pred.p2[,1],
                                 pred.p3[,2] - pred.p3[,1],
                                 pred.p4[,2] - pred.p4[,1]))
  pred.probs <- t(apply(pred.probs, 2, 
                        quantile, 
                        c(0.05,0.5,0.95)))
  pred.probs <- data.frame(pred.probs,
                           trait,
                           ideo, 
                           office,
                           outcome = 1:4,
                           row.names = NULL)
  return(pred.probs)
}      

# high-information function
frame_gen_mfx_highinfo <- function(trait, ideo, office){  
  set.seed(1)
  # remove random effects
  newcoefs <- rmvnorm(100000, mean = coef(eval(parse(text = paste('mod.', 
                                                                  office, 
                                                                  '.val.4.ordered.highinfo', 
                                                                  sep = "")))), 
                              sigma = vcov(eval(parse(text = paste('mod.', 
                                                                   office, 
                                                                   '.val.4.ordered.highinfo', 
                                                                   sep = ""))))[-grep("ST",colnames(vcov(eval(parse(text = paste('mod.', office, '.val.4.ordered.highinfo', sep = "")))))),
                                                                                -grep("ST",colnames(vcov(eval(parse(text = paste('mod.', office, '.val.4.ordered.highinfo', sep = ""))))))])
  colnames(newcoefs) <- rownames(data.frame(mod.all.val.4.ordered.highinfo$coef))
  trait <- grep(trait, c("openn", "consc", "extra", "agree", "emoti"), ignore.case=TRUE, value=TRUE)
  office <- grep(office, c("all", "rep", "sen"), ignore.case = TRUE, value = TRUE)
  b5.foo <- seq(mean(unlist(eval(parse(text = paste('mod.', office, 
                                                    '.val.4.ordered.highinfo$model', 
                                                    sep = "")))[paste('cong_', trait, sep="")])) - 
                  sd(unlist(eval(parse(text = paste('mod.', office, 
                                                    '.val.4.ordered.highinfo$model', 
                                                    sep = "")))[paste('cong_', trait, sep="")])),
                mean(unlist(eval(parse(text = paste('mod.', office, 
                                                    '.val.4.ordered.highinfo$model', 
                                                    sep = "")))[paste('cong_', trait, sep="")])) + 
                  sd(unlist(eval(parse(text = paste('mod.', office, 
                                                    '.val.4.ordered.highinfo$model', 
                                                    sep = "")))[paste('cong_', trait, sep="")])),
                length.out = 2) 
  ideo <- grep(ideo, c("Liberal","Moderate","Conservative"), ignore.case=TRUE, value=TRUE)
  ideosign <- ((-1)*(ideo == "Liberal")) + ((0)*(ideo == "Moderate")) + ((1)*(ideo == "Conservative"))
  pred.frame <- data.frame(matrix(NA, ncol = length(eval(parse(text = paste('mod.', 
                                                                            office, 
                                                                            '.val.4.ordered.highinfo$coef', 
                                                                            sep = "")))) - 3, 
                                  nrow = length(b5.foo)))
  colnames(pred.frame) <- rownames(data.frame(eval(parse(text = paste('mod.', 
                                                                      office, 
                                                                      '.val.4.ordered.highinfo$coef', 
                                                                      sep = "")))))[-c(1:3)]
  pred.frame['cong_openn'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', 
                                           office, '.val.4.ordered.highinfo$model', 
                                           sep = "")))['cong_openn']))
  pred.frame['cong_consc'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', 
                                           office, '.val.4.ordered.highinfo$model', 
                                           sep = "")))['cong_consc']))
  pred.frame['cong_extra'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', 
                                           office, '.val.4.ordered.highinfo$model', 
                                           sep = "")))['cong_extra']))
  pred.frame['cong_agree'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', 
                                           office, '.val.4.ordered.highinfo$model', 
                                           sep = "")))['cong_agree']))
  pred.frame['cong_emoti'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', office, 
                                           '.val.4.ordered.highinfo$model', 
                                           sep = "")))['cong_emoti']))
  pred.frame['scaled_info'] <- 
    mean(as.matrix(eval(parse(text = paste('mod.', office, 
                                           '.val.4.ordered.highinfo$model', 
                                           sep = "")))['scaled_info']))
  pred.frame[paste('cong_', trait, sep="")] <- b5.foo
  pred.frame['respondent_AM'] <- 
    0 + ideosign*sd(as.matrix(eval(parse(text = paste('mod.', office, 
                                                      '.val.4.ordered.highinfo$model', 
                                                      sep = "")))['respondent_AM']))
  pred.frame['I(abs(respondent_AM))'] <- abs(pred.frame['respondent_AM'])
  pred.frame['I(abs(respondent_AM - cong_AM))'] <- 
    abs(pred.frame['respondent_AM'] - mean(cces.uber$cong_AM, na.rm = TRUE))
  pred.frame['respondent_AM:cong_openn'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_openn']
  pred.frame['respondent_AM:cong_consc'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_consc']
  pred.frame['respondent_AM:cong_extra'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_extra']
  pred.frame['respondent_AM:cong_agree'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_agree']
  pred.frame['respondent_AM:cong_emoti'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_emoti']
  pred.frame['I(abs(respondent_AM)):cong_openn'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_openn']
  pred.frame['I(abs(respondent_AM)):cong_consc'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_consc']
  pred.frame['I(abs(respondent_AM)):cong_extra'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_extra']
  pred.frame['I(abs(respondent_AM)):cong_agree'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_agree']
  pred.frame['I(abs(respondent_AM)):cong_emoti'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_emoti']
  
  # predicted probabilities, with random effects marginalized out
  pred.xb <- t(as.matrix(pred.frame)%*%t(newcoefs[,-c(1:3)]))
  pred.xb1 <- newcoefs[,1] - pred.xb
  pred.xb2 <- newcoefs[,2] - pred.xb
  pred.xb3 <- newcoefs[,3] - pred.xb        
  pred.p1 <- plogis(pred.xb1)
  pred.p2 <- plogis(pred.xb2) - plogis(pred.xb1)
  pred.p3 <- plogis(pred.xb3) - plogis(pred.xb2)
  pred.p4 <- 1 - plogis(pred.xb3)
  pred.probs <- data.frame(cbind(pred.p1[,2] - pred.p1[,1],
                                 pred.p2[,2] - pred.p2[,1],
                                 pred.p3[,2] - pred.p3[,1],
                                 pred.p4[,2] - pred.p4[,1]))
  pred.probs <- t(apply(pred.probs, 2, quantile, 
                        c(0.05,0.5,0.95)))
  pred.probs <- data.frame(pred.probs,
                           trait,
                           ideo, 
                           office,
                           outcome = 1:4,
                           row.names = NULL)
  return(pred.probs)
}      


# generating a bunch of marginal effects
openn.lib.mfx.all <- frame_gen_mfx("openn", "lib", "all")                               
openn.mod.mfx.all <- frame_gen_mfx("openn", "mod", "all")
openn.con.mfx.all <- frame_gen_mfx("openn", "con", "all")
consc.lib.mfx.all <- frame_gen_mfx("consc", "lib", "all")                               
consc.mod.mfx.all <- frame_gen_mfx("consc", "mod", "all")
consc.con.mfx.all <- frame_gen_mfx("consc", "con", "all")
extra.lib.mfx.all <- frame_gen_mfx("extra", "lib", "all")                               
extra.mod.mfx.all <- frame_gen_mfx("extra", "mod", "all")
extra.con.mfx.all <- frame_gen_mfx("extra", "con", "all")
agree.lib.mfx.all <- frame_gen_mfx("agree", "lib", "all")                               
agree.mod.mfx.all <- frame_gen_mfx("agree", "mod", "all")
agree.con.mfx.all <- frame_gen_mfx("agree", "con", "all")
emoti.lib.mfx.all <- frame_gen_mfx("emoti", "lib", "all")                               
emoti.mod.mfx.all <- frame_gen_mfx("emoti", "mod", "all")
emoti.con.mfx.all <- frame_gen_mfx("emoti", "con", "all")

openn.lib.mfx.all.copartisans <- frame_gen_mfx_copartisans("openn", "lib", "all")                               
openn.mod.mfx.all.copartisans <- frame_gen_mfx_copartisans("openn", "mod", "all")
openn.con.mfx.all.copartisans <- frame_gen_mfx_copartisans("openn", "con", "all")
consc.lib.mfx.all.copartisans <- frame_gen_mfx_copartisans("consc", "lib", "all")                               
consc.mod.mfx.all.copartisans <- frame_gen_mfx_copartisans("consc", "mod", "all")
consc.con.mfx.all.copartisans <- frame_gen_mfx_copartisans("consc", "con", "all")
extra.lib.mfx.all.copartisans <- frame_gen_mfx_copartisans("extra", "lib", "all")                               
extra.mod.mfx.all.copartisans <- frame_gen_mfx_copartisans("extra", "mod", "all")
extra.con.mfx.all.copartisans <- frame_gen_mfx_copartisans("extra", "con", "all")
agree.lib.mfx.all.copartisans <- frame_gen_mfx_copartisans("agree", "lib", "all")                               
agree.mod.mfx.all.copartisans <- frame_gen_mfx_copartisans("agree", "mod", "all")
agree.con.mfx.all.copartisans <- frame_gen_mfx_copartisans("agree", "con", "all")
emoti.lib.mfx.all.copartisans <- frame_gen_mfx_copartisans("emoti", "lib", "all")                               
emoti.mod.mfx.all.copartisans <- frame_gen_mfx_copartisans("emoti", "mod", "all")
emoti.con.mfx.all.copartisans <- frame_gen_mfx_copartisans("emoti", "con", "all")

openn.lib.mfx.all.nopartisans <- frame_gen_mfx_nopartisans("openn", "lib", "all")                               
openn.mod.mfx.all.nopartisans <- frame_gen_mfx_nopartisans("openn", "mod", "all")
openn.con.mfx.all.nopartisans <- frame_gen_mfx_nopartisans("openn", "con", "all")
consc.lib.mfx.all.nopartisans <- frame_gen_mfx_nopartisans("consc", "lib", "all")                               
consc.mod.mfx.all.nopartisans <- frame_gen_mfx_nopartisans("consc", "mod", "all")
consc.con.mfx.all.nopartisans <- frame_gen_mfx_nopartisans("consc", "con", "all")
extra.lib.mfx.all.nopartisans <- frame_gen_mfx_nopartisans("extra", "lib", "all")                               
extra.mod.mfx.all.nopartisans <- frame_gen_mfx_nopartisans("extra", "mod", "all")
extra.con.mfx.all.nopartisans <- frame_gen_mfx_nopartisans("extra", "con", "all")
agree.lib.mfx.all.nopartisans <- frame_gen_mfx_nopartisans("agree", "lib", "all")                               
agree.mod.mfx.all.nopartisans <- frame_gen_mfx_nopartisans("agree", "mod", "all")
agree.con.mfx.all.nopartisans <- frame_gen_mfx_nopartisans("agree", "con", "all")
emoti.lib.mfx.all.nopartisans <- frame_gen_mfx_nopartisans("emoti", "lib", "all")                               
emoti.mod.mfx.all.nopartisans <- frame_gen_mfx_nopartisans("emoti", "mod", "all")
emoti.con.mfx.all.nopartisans <- frame_gen_mfx_nopartisans("emoti", "con", "all")

openn.lib.mfx.all.lowinfo <- frame_gen_mfx_lowinfo("openn", "lib", "all")                               
openn.mod.mfx.all.lowinfo <- frame_gen_mfx_lowinfo("openn", "mod", "all")
openn.con.mfx.all.lowinfo <- frame_gen_mfx_lowinfo("openn", "con", "all")
consc.lib.mfx.all.lowinfo <- frame_gen_mfx_lowinfo("consc", "lib", "all")                               
consc.mod.mfx.all.lowinfo <- frame_gen_mfx_lowinfo("consc", "mod", "all")
consc.con.mfx.all.lowinfo <- frame_gen_mfx_lowinfo("consc", "con", "all")
extra.lib.mfx.all.lowinfo <- frame_gen_mfx_lowinfo("extra", "lib", "all")                               
extra.mod.mfx.all.lowinfo <- frame_gen_mfx_lowinfo("extra", "mod", "all")
extra.con.mfx.all.lowinfo <- frame_gen_mfx_lowinfo("extra", "con", "all")
agree.lib.mfx.all.lowinfo <- frame_gen_mfx_lowinfo("agree", "lib", "all")                               
agree.mod.mfx.all.lowinfo <- frame_gen_mfx_lowinfo("agree", "mod", "all")
agree.con.mfx.all.lowinfo <- frame_gen_mfx_lowinfo("agree", "con", "all")
emoti.lib.mfx.all.lowinfo <- frame_gen_mfx_lowinfo("emoti", "lib", "all")                               
emoti.mod.mfx.all.lowinfo <- frame_gen_mfx_lowinfo("emoti", "mod", "all")
emoti.con.mfx.all.lowinfo <- frame_gen_mfx_lowinfo("emoti", "con", "all")

openn.lib.mfx.all.highinfo <- frame_gen_mfx_highinfo("openn", "lib", "all")                               
openn.mod.mfx.all.highinfo <- frame_gen_mfx_highinfo("openn", "mod", "all")
openn.con.mfx.all.highinfo <- frame_gen_mfx_highinfo("openn", "con", "all")
consc.lib.mfx.all.highinfo <- frame_gen_mfx_highinfo("consc", "lib", "all")                               
consc.mod.mfx.all.highinfo <- frame_gen_mfx_highinfo("consc", "mod", "all")
consc.con.mfx.all.highinfo <- frame_gen_mfx_highinfo("consc", "con", "all")
extra.lib.mfx.all.highinfo <- frame_gen_mfx_highinfo("extra", "lib", "all")                               
extra.mod.mfx.all.highinfo <- frame_gen_mfx_highinfo("extra", "mod", "all")
extra.con.mfx.all.highinfo <- frame_gen_mfx_highinfo("extra", "con", "all")
agree.lib.mfx.all.highinfo <- frame_gen_mfx_highinfo("agree", "lib", "all")                               
agree.mod.mfx.all.highinfo <- frame_gen_mfx_highinfo("agree", "mod", "all")
agree.con.mfx.all.highinfo <- frame_gen_mfx_highinfo("agree", "con", "all")
emoti.lib.mfx.all.highinfo <- frame_gen_mfx_highinfo("emoti", "lib", "all")                               
emoti.mod.mfx.all.highinfo <- frame_gen_mfx_highinfo("emoti", "mod", "all")
emoti.con.mfx.all.highinfo <- frame_gen_mfx_highinfo("emoti", "con", "all")

openn.lib.mfx.rep <- frame_gen_mfx("openn", "lib", "rep")                               
openn.mod.mfx.rep <- frame_gen_mfx("openn", "mod", "rep")
openn.con.mfx.rep <- frame_gen_mfx("openn", "con", "rep")
consc.lib.mfx.rep <- frame_gen_mfx("consc", "lib", "rep")                               
consc.mod.mfx.rep <- frame_gen_mfx("consc", "mod", "rep")
consc.con.mfx.rep <- frame_gen_mfx("consc", "con", "rep")
extra.lib.mfx.rep <- frame_gen_mfx("extra", "lib", "rep")                               
extra.mod.mfx.rep <- frame_gen_mfx("extra", "mod", "rep")
extra.con.mfx.rep <- frame_gen_mfx("extra", "con", "rep")
agree.lib.mfx.rep <- frame_gen_mfx("agree", "lib", "rep")                               
agree.mod.mfx.rep <- frame_gen_mfx("agree", "mod", "rep")
agree.con.mfx.rep <- frame_gen_mfx("agree", "con", "rep")
emoti.lib.mfx.rep <- frame_gen_mfx("emoti", "lib", "rep")                               
emoti.mod.mfx.rep <- frame_gen_mfx("emoti", "mod", "rep")
emoti.con.mfx.rep <- frame_gen_mfx("emoti", "con", "rep")

openn.lib.mfx.rep.copartisans <- frame_gen_mfx_copartisans("openn", "lib", "rep")                               
openn.mod.mfx.rep.copartisans <- frame_gen_mfx_copartisans("openn", "mod", "rep")
openn.con.mfx.rep.copartisans <- frame_gen_mfx_copartisans("openn", "con", "rep")
consc.lib.mfx.rep.copartisans <- frame_gen_mfx_copartisans("consc", "lib", "rep")                               
consc.mod.mfx.rep.copartisans <- frame_gen_mfx_copartisans("consc", "mod", "rep")
consc.con.mfx.rep.copartisans <- frame_gen_mfx_copartisans("consc", "con", "rep")
extra.lib.mfx.rep.copartisans <- frame_gen_mfx_copartisans("extra", "lib", "rep")                               
extra.mod.mfx.rep.copartisans <- frame_gen_mfx_copartisans("extra", "mod", "rep")
extra.con.mfx.rep.copartisans <- frame_gen_mfx_copartisans("extra", "con", "rep")
agree.lib.mfx.rep.copartisans <- frame_gen_mfx_copartisans("agree", "lib", "rep")                               
agree.mod.mfx.rep.copartisans <- frame_gen_mfx_copartisans("agree", "mod", "rep")
agree.con.mfx.rep.copartisans <- frame_gen_mfx_copartisans("agree", "con", "rep")
emoti.lib.mfx.rep.copartisans <- frame_gen_mfx_copartisans("emoti", "lib", "rep")                               
emoti.mod.mfx.rep.copartisans <- frame_gen_mfx_copartisans("emoti", "mod", "rep")
emoti.con.mfx.rep.copartisans <- frame_gen_mfx_copartisans("emoti", "con", "rep")

openn.lib.mfx.rep.nopartisans <- frame_gen_mfx_nopartisans_rep("openn", "lib", "rep")                               
openn.mod.mfx.rep.nopartisans <- frame_gen_mfx_nopartisans_rep("openn", "mod", "rep")
openn.con.mfx.rep.nopartisans <- frame_gen_mfx_nopartisans_rep("openn", "con", "rep")
consc.lib.mfx.rep.nopartisans <- frame_gen_mfx_nopartisans_rep("consc", "lib", "rep")                               
consc.mod.mfx.rep.nopartisans <- frame_gen_mfx_nopartisans_rep("consc", "mod", "rep")
consc.con.mfx.rep.nopartisans <- frame_gen_mfx_nopartisans_rep("consc", "con", "rep")
extra.lib.mfx.rep.nopartisans <- frame_gen_mfx_nopartisans_rep("extra", "lib", "rep")                               
extra.mod.mfx.rep.nopartisans <- frame_gen_mfx_nopartisans_rep("extra", "mod", "rep")
extra.con.mfx.rep.nopartisans <- frame_gen_mfx_nopartisans_rep("extra", "con", "rep")
agree.lib.mfx.rep.nopartisans <- frame_gen_mfx_nopartisans_rep("agree", "lib", "rep")                               
agree.mod.mfx.rep.nopartisans <- frame_gen_mfx_nopartisans_rep("agree", "mod", "rep")
agree.con.mfx.rep.nopartisans <- frame_gen_mfx_nopartisans_rep("agree", "con", "rep")
emoti.lib.mfx.rep.nopartisans <- frame_gen_mfx_nopartisans_rep("emoti", "lib", "rep")                               
emoti.mod.mfx.rep.nopartisans <- frame_gen_mfx_nopartisans_rep("emoti", "mod", "rep")
emoti.con.mfx.rep.nopartisans <- frame_gen_mfx_nopartisans_rep("emoti", "con", "rep")

openn.lib.mfx.rep.lowinfo <- frame_gen_mfx_lowinfo_rep("openn", "lib", "rep")                               
openn.mod.mfx.rep.lowinfo <- frame_gen_mfx_lowinfo_rep("openn", "mod", "rep")
openn.con.mfx.rep.lowinfo <- frame_gen_mfx_lowinfo_rep("openn", "con", "rep")
consc.lib.mfx.rep.lowinfo <- frame_gen_mfx_lowinfo_rep("consc", "lib", "rep")                               
consc.mod.mfx.rep.lowinfo <- frame_gen_mfx_lowinfo_rep("consc", "mod", "rep")
consc.con.mfx.rep.lowinfo <- frame_gen_mfx_lowinfo_rep("consc", "con", "rep")
extra.lib.mfx.rep.lowinfo <- frame_gen_mfx_lowinfo_rep("extra", "lib", "rep")                               
extra.mod.mfx.rep.lowinfo <- frame_gen_mfx_lowinfo_rep("extra", "mod", "rep")
extra.con.mfx.rep.lowinfo <- frame_gen_mfx_lowinfo_rep("extra", "con", "rep")
agree.lib.mfx.rep.lowinfo <- frame_gen_mfx_lowinfo_rep("agree", "lib", "rep")                               
agree.mod.mfx.rep.lowinfo <- frame_gen_mfx_lowinfo_rep("agree", "mod", "rep")
agree.con.mfx.rep.lowinfo <- frame_gen_mfx_lowinfo_rep("agree", "con", "rep")
emoti.lib.mfx.rep.lowinfo <- frame_gen_mfx_lowinfo_rep("emoti", "lib", "rep")                               
emoti.mod.mfx.rep.lowinfo <- frame_gen_mfx_lowinfo_rep("emoti", "mod", "rep")
emoti.con.mfx.rep.lowinfo <- frame_gen_mfx_lowinfo_rep("emoti", "con", "rep")

openn.lib.mfx.rep.highinfo <- frame_gen_mfx_highinfo("openn", "lib", "rep")                               
openn.mod.mfx.rep.highinfo <- frame_gen_mfx_highinfo("openn", "mod", "rep")
openn.con.mfx.rep.highinfo <- frame_gen_mfx_highinfo("openn", "con", "rep")
consc.lib.mfx.rep.highinfo <- frame_gen_mfx_highinfo("consc", "lib", "rep")                               
consc.mod.mfx.rep.highinfo <- frame_gen_mfx_highinfo("consc", "mod", "rep")
consc.con.mfx.rep.highinfo <- frame_gen_mfx_highinfo("consc", "con", "rep")
extra.lib.mfx.rep.highinfo <- frame_gen_mfx_highinfo("extra", "lib", "rep")                               
extra.mod.mfx.rep.highinfo <- frame_gen_mfx_highinfo("extra", "mod", "rep")
extra.con.mfx.rep.highinfo <- frame_gen_mfx_highinfo("extra", "con", "rep")
agree.lib.mfx.rep.highinfo <- frame_gen_mfx_highinfo("agree", "lib", "rep")                               
agree.mod.mfx.rep.highinfo <- frame_gen_mfx_highinfo("agree", "mod", "rep")
agree.con.mfx.rep.highinfo <- frame_gen_mfx_highinfo("agree", "con", "rep")
emoti.lib.mfx.rep.highinfo <- frame_gen_mfx_highinfo("emoti", "lib", "rep")                               
emoti.mod.mfx.rep.highinfo <- frame_gen_mfx_highinfo("emoti", "mod", "rep")
emoti.con.mfx.rep.highinfo <- frame_gen_mfx_highinfo("emoti", "con", "rep")

openn.lib.mfx.sen <- frame_gen_mfx("openn", "lib", "sen")                               
openn.mod.mfx.sen <- frame_gen_mfx("openn", "mod", "sen")
openn.con.mfx.sen <- frame_gen_mfx("openn", "con", "sen")
consc.lib.mfx.sen <- frame_gen_mfx("consc", "lib", "sen")                               
consc.mod.mfx.sen <- frame_gen_mfx("consc", "mod", "sen")
consc.con.mfx.sen <- frame_gen_mfx("consc", "con", "sen")
extra.lib.mfx.sen <- frame_gen_mfx("extra", "lib", "sen")                               
extra.mod.mfx.sen <- frame_gen_mfx("extra", "mod", "sen")
extra.con.mfx.sen <- frame_gen_mfx("extra", "con", "sen")
agree.lib.mfx.sen <- frame_gen_mfx("agree", "lib", "sen")                               
agree.mod.mfx.sen <- frame_gen_mfx("agree", "mod", "sen")
agree.con.mfx.sen <- frame_gen_mfx("agree", "con", "sen")
emoti.lib.mfx.sen <- frame_gen_mfx("emoti", "lib", "sen")                               
emoti.mod.mfx.sen <- frame_gen_mfx("emoti", "mod", "sen")
emoti.con.mfx.sen <- frame_gen_mfx("emoti", "con", "sen")

openn.lib.mfx.sen.copartisans <- frame_gen_mfx_copartisans("openn", "lib", "sen")                               
openn.mod.mfx.sen.copartisans <- frame_gen_mfx_copartisans("openn", "mod", "sen")
openn.con.mfx.sen.copartisans <- frame_gen_mfx_copartisans("openn", "con", "sen")
consc.lib.mfx.sen.copartisans <- frame_gen_mfx_copartisans("consc", "lib", "sen")                               
consc.mod.mfx.sen.copartisans <- frame_gen_mfx_copartisans("consc", "mod", "sen")
consc.con.mfx.sen.copartisans <- frame_gen_mfx_copartisans("consc", "con", "sen")
extra.lib.mfx.sen.copartisans <- frame_gen_mfx_copartisans("extra", "lib", "sen")                               
extra.mod.mfx.sen.copartisans <- frame_gen_mfx_copartisans("extra", "mod", "sen")
extra.con.mfx.sen.copartisans <- frame_gen_mfx_copartisans("extra", "con", "sen")
agree.lib.mfx.sen.copartisans <- frame_gen_mfx_copartisans("agree", "lib", "sen")                               
agree.mod.mfx.sen.copartisans <- frame_gen_mfx_copartisans("agree", "mod", "sen")
agree.con.mfx.sen.copartisans <- frame_gen_mfx_copartisans("agree", "con", "sen")
emoti.lib.mfx.sen.copartisans <- frame_gen_mfx_copartisans("emoti", "lib", "sen")                               
emoti.mod.mfx.sen.copartisans <- frame_gen_mfx_copartisans("emoti", "mod", "sen")
emoti.con.mfx.sen.copartisans <- frame_gen_mfx_copartisans("emoti", "con", "sen")

openn.lib.mfx.sen.nopartisans <- frame_gen_mfx_nopartisans("openn", "lib", "sen")                               
openn.mod.mfx.sen.nopartisans <- frame_gen_mfx_nopartisans("openn", "mod", "sen")
openn.con.mfx.sen.nopartisans <- frame_gen_mfx_nopartisans("openn", "con", "sen")
consc.lib.mfx.sen.nopartisans <- frame_gen_mfx_nopartisans("consc", "lib", "sen")                               
consc.mod.mfx.sen.nopartisans <- frame_gen_mfx_nopartisans("consc", "mod", "sen")
consc.con.mfx.sen.nopartisans <- frame_gen_mfx_nopartisans("consc", "con", "sen")
extra.lib.mfx.sen.nopartisans <- frame_gen_mfx_nopartisans("extra", "lib", "sen")                               
extra.mod.mfx.sen.nopartisans <- frame_gen_mfx_nopartisans("extra", "mod", "sen")
extra.con.mfx.sen.nopartisans <- frame_gen_mfx_nopartisans("extra", "con", "sen")
agree.lib.mfx.sen.nopartisans <- frame_gen_mfx_nopartisans("agree", "lib", "sen")                               
agree.mod.mfx.sen.nopartisans <- frame_gen_mfx_nopartisans("agree", "mod", "sen")
agree.con.mfx.sen.nopartisans <- frame_gen_mfx_nopartisans("agree", "con", "sen")
emoti.lib.mfx.sen.nopartisans <- frame_gen_mfx_nopartisans("emoti", "lib", "sen")                               
emoti.mod.mfx.sen.nopartisans <- frame_gen_mfx_nopartisans("emoti", "mod", "sen")
emoti.con.mfx.sen.nopartisans <- frame_gen_mfx_nopartisans("emoti", "con", "sen")

openn.lib.mfx.sen.lowinfo <- frame_gen_mfx_lowinfo("openn", "lib", "sen")                               
openn.mod.mfx.sen.lowinfo <- frame_gen_mfx_lowinfo("openn", "mod", "sen")
openn.con.mfx.sen.lowinfo <- frame_gen_mfx_lowinfo("openn", "con", "sen")
consc.lib.mfx.sen.lowinfo <- frame_gen_mfx_lowinfo("consc", "lib", "sen")                               
consc.mod.mfx.sen.lowinfo <- frame_gen_mfx_lowinfo("consc", "mod", "sen")
consc.con.mfx.sen.lowinfo <- frame_gen_mfx_lowinfo("consc", "con", "sen")
extra.lib.mfx.sen.lowinfo <- frame_gen_mfx_lowinfo("extra", "lib", "sen")                               
extra.mod.mfx.sen.lowinfo <- frame_gen_mfx_lowinfo("extra", "mod", "sen")
extra.con.mfx.sen.lowinfo <- frame_gen_mfx_lowinfo("extra", "con", "sen")
agree.lib.mfx.sen.lowinfo <- frame_gen_mfx_lowinfo("agree", "lib", "sen")                               
agree.mod.mfx.sen.lowinfo <- frame_gen_mfx_lowinfo("agree", "mod", "sen")
agree.con.mfx.sen.lowinfo <- frame_gen_mfx_lowinfo("agree", "con", "sen")
emoti.lib.mfx.sen.lowinfo <- frame_gen_mfx_lowinfo("emoti", "lib", "sen")                               
emoti.mod.mfx.sen.lowinfo <- frame_gen_mfx_lowinfo("emoti", "mod", "sen")
emoti.con.mfx.sen.lowinfo <- frame_gen_mfx_lowinfo("emoti", "con", "sen")

openn.lib.mfx.sen.highinfo <- frame_gen_mfx_highinfo("openn", "lib", "sen")                               
openn.mod.mfx.sen.highinfo <- frame_gen_mfx_highinfo("openn", "mod", "sen")
openn.con.mfx.sen.highinfo <- frame_gen_mfx_highinfo("openn", "con", "sen")
consc.lib.mfx.sen.highinfo <- frame_gen_mfx_highinfo("consc", "lib", "sen")                               
consc.mod.mfx.sen.highinfo <- frame_gen_mfx_highinfo("consc", "mod", "sen")
consc.con.mfx.sen.highinfo <- frame_gen_mfx_highinfo("consc", "con", "sen")
extra.lib.mfx.sen.highinfo <- frame_gen_mfx_highinfo("extra", "lib", "sen")                               
extra.mod.mfx.sen.highinfo <- frame_gen_mfx_highinfo("extra", "mod", "sen")
extra.con.mfx.sen.highinfo <- frame_gen_mfx_highinfo("extra", "con", "sen")
agree.lib.mfx.sen.highinfo <- frame_gen_mfx_highinfo("agree", "lib", "sen")                               
agree.mod.mfx.sen.highinfo <- frame_gen_mfx_highinfo("agree", "mod", "sen")
agree.con.mfx.sen.highinfo <- frame_gen_mfx_highinfo("agree", "con", "sen")
emoti.lib.mfx.sen.highinfo <- frame_gen_mfx_highinfo("emoti", "lib", "sen")                               
emoti.mod.mfx.sen.highinfo <- frame_gen_mfx_highinfo("emoti", "mod", "sen")
emoti.con.mfx.sen.highinfo <- frame_gen_mfx_highinfo("emoti", "con", "sen")

# combining all the marginal effects into a data frome for plotting
mfx.frame <- rbind(openn.lib.mfx.all,                               
                   openn.mod.mfx.all,
                   openn.con.mfx.all,
                   consc.lib.mfx.all,
                   consc.mod.mfx.all, 
                   consc.con.mfx.all, 
                   extra.lib.mfx.all, 
                   extra.mod.mfx.all, 
                   extra.con.mfx.all, 
                   agree.lib.mfx.all, 
                   agree.mod.mfx.all, 
                   agree.con.mfx.all, 
                   emoti.lib.mfx.all, 
                   emoti.mod.mfx.all, 
                   emoti.con.mfx.all,
                   openn.lib.mfx.rep,
                   openn.mod.mfx.rep,
                   openn.con.mfx.rep,
                   consc.lib.mfx.rep,
                   consc.mod.mfx.rep,
                   consc.con.mfx.rep,
                   extra.lib.mfx.rep,
                   extra.mod.mfx.rep,
                   extra.con.mfx.rep,
                   agree.lib.mfx.rep,
                   agree.mod.mfx.rep,
                   agree.con.mfx.rep,
                   emoti.lib.mfx.rep,
                   emoti.mod.mfx.rep,
                   emoti.con.mfx.rep,
                   openn.lib.mfx.sen,
                   openn.mod.mfx.sen,
                   openn.con.mfx.sen,
                   consc.lib.mfx.sen,
                   consc.mod.mfx.sen,
                   consc.con.mfx.sen,
                   extra.lib.mfx.sen,
                   extra.mod.mfx.sen,
                   extra.con.mfx.sen,
                   agree.lib.mfx.sen,
                   agree.mod.mfx.sen,
                   agree.con.mfx.sen,
                   emoti.lib.mfx.sen,
                   emoti.mod.mfx.sen,
                   emoti.con.mfx.sen) 

mfx.frame.copartisans <- rbind(openn.lib.mfx.all.copartisans,                               
                               openn.mod.mfx.all.copartisans,
                               openn.con.mfx.all.copartisans,
                               consc.lib.mfx.all.copartisans,
                               consc.mod.mfx.all.copartisans, 
                               consc.con.mfx.all.copartisans, 
                               extra.lib.mfx.all.copartisans, 
                               extra.mod.mfx.all.copartisans, 
                               extra.con.mfx.all.copartisans, 
                               agree.lib.mfx.all.copartisans, 
                               agree.mod.mfx.all.copartisans, 
                               agree.con.mfx.all.copartisans, 
                               emoti.lib.mfx.all.copartisans, 
                               emoti.mod.mfx.all.copartisans, 
                               emoti.con.mfx.all.copartisans,
                               openn.lib.mfx.rep.copartisans,
                               openn.mod.mfx.rep.copartisans,
                               openn.con.mfx.rep.copartisans,
                               consc.lib.mfx.rep.copartisans,
                               consc.mod.mfx.rep.copartisans,
                               consc.con.mfx.rep.copartisans,
                               extra.lib.mfx.rep.copartisans,
                               extra.mod.mfx.rep.copartisans,
                               extra.con.mfx.rep.copartisans,
                               agree.lib.mfx.rep.copartisans,
                               agree.mod.mfx.rep.copartisans,
                               agree.con.mfx.rep.copartisans,
                               emoti.lib.mfx.rep.copartisans,
                               emoti.mod.mfx.rep.copartisans,
                               emoti.con.mfx.rep.copartisans,
                               openn.lib.mfx.sen.copartisans,
                               openn.mod.mfx.sen.copartisans,
                               openn.con.mfx.sen.copartisans,
                               consc.lib.mfx.sen.copartisans,
                               consc.mod.mfx.sen.copartisans,
                               consc.con.mfx.sen.copartisans,
                               extra.lib.mfx.sen.copartisans,
                               extra.mod.mfx.sen.copartisans,
                               extra.con.mfx.sen.copartisans,
                               agree.lib.mfx.sen.copartisans,
                               agree.mod.mfx.sen.copartisans,
                               agree.con.mfx.sen.copartisans,
                               emoti.lib.mfx.sen.copartisans,
                               emoti.mod.mfx.sen.copartisans,
                               emoti.con.mfx.sen.copartisans) 

mfx.frame.nopartisans <- rbind(openn.lib.mfx.all.nopartisans,                               
                               openn.mod.mfx.all.nopartisans,
                               openn.con.mfx.all.nopartisans,
                               consc.lib.mfx.all.nopartisans,
                               consc.mod.mfx.all.nopartisans, 
                               consc.con.mfx.all.nopartisans, 
                               extra.lib.mfx.all.nopartisans, 
                               extra.mod.mfx.all.nopartisans, 
                               extra.con.mfx.all.nopartisans, 
                               agree.lib.mfx.all.nopartisans, 
                               agree.mod.mfx.all.nopartisans, 
                               agree.con.mfx.all.nopartisans, 
                               emoti.lib.mfx.all.nopartisans, 
                               emoti.mod.mfx.all.nopartisans, 
                               emoti.con.mfx.all.nopartisans,
                               openn.lib.mfx.rep.nopartisans,
                               openn.mod.mfx.rep.nopartisans,
                               openn.con.mfx.rep.nopartisans,
                               consc.lib.mfx.rep.nopartisans,
                               consc.mod.mfx.rep.nopartisans,
                               consc.con.mfx.rep.nopartisans,
                               extra.lib.mfx.rep.nopartisans,
                               extra.mod.mfx.rep.nopartisans,
                               extra.con.mfx.rep.nopartisans,
                               agree.lib.mfx.rep.nopartisans,
                               agree.mod.mfx.rep.nopartisans,
                               agree.con.mfx.rep.nopartisans,
                               emoti.lib.mfx.rep.nopartisans,
                               emoti.mod.mfx.rep.nopartisans,
                               emoti.con.mfx.rep.nopartisans,
                               openn.lib.mfx.sen.nopartisans,
                               openn.mod.mfx.sen.nopartisans,
                               openn.con.mfx.sen.nopartisans,
                               consc.lib.mfx.sen.nopartisans,
                               consc.mod.mfx.sen.nopartisans,
                               consc.con.mfx.sen.nopartisans,
                               extra.lib.mfx.sen.nopartisans,
                               extra.mod.mfx.sen.nopartisans,
                               extra.con.mfx.sen.nopartisans,
                               agree.lib.mfx.sen.nopartisans,
                               agree.mod.mfx.sen.nopartisans,
                               agree.con.mfx.sen.nopartisans,
                               emoti.lib.mfx.sen.nopartisans,
                               emoti.mod.mfx.sen.nopartisans,
                               emoti.con.mfx.sen.nopartisans) 

mfx.frame.lowinfo <- rbind(openn.lib.mfx.all.lowinfo,                               
                           openn.mod.mfx.all.lowinfo,
                           openn.con.mfx.all.lowinfo,
                           consc.lib.mfx.all.lowinfo,
                           consc.mod.mfx.all.lowinfo, 
                           consc.con.mfx.all.lowinfo, 
                           extra.lib.mfx.all.lowinfo, 
                           extra.mod.mfx.all.lowinfo, 
                           extra.con.mfx.all.lowinfo, 
                           agree.lib.mfx.all.lowinfo, 
                           agree.mod.mfx.all.lowinfo, 
                           agree.con.mfx.all.lowinfo, 
                           emoti.lib.mfx.all.lowinfo, 
                           emoti.mod.mfx.all.lowinfo, 
                           emoti.con.mfx.all.lowinfo,
                           openn.lib.mfx.rep.lowinfo,
                           openn.mod.mfx.rep.lowinfo,
                           openn.con.mfx.rep.lowinfo,
                           consc.lib.mfx.rep.lowinfo,
                           consc.mod.mfx.rep.lowinfo,
                           consc.con.mfx.rep.lowinfo,
                           extra.lib.mfx.rep.lowinfo,
                           extra.mod.mfx.rep.lowinfo,
                           extra.con.mfx.rep.lowinfo,
                           agree.lib.mfx.rep.lowinfo,
                           agree.mod.mfx.rep.lowinfo,
                           agree.con.mfx.rep.lowinfo,
                           emoti.lib.mfx.rep.lowinfo,
                           emoti.mod.mfx.rep.lowinfo,
                           emoti.con.mfx.rep.lowinfo,
                           openn.lib.mfx.sen.lowinfo,
                           openn.mod.mfx.sen.lowinfo,
                           openn.con.mfx.sen.lowinfo,
                           consc.lib.mfx.sen.lowinfo,
                           consc.mod.mfx.sen.lowinfo,
                           consc.con.mfx.sen.lowinfo,
                           extra.lib.mfx.sen.lowinfo,
                           extra.mod.mfx.sen.lowinfo,
                           extra.con.mfx.sen.lowinfo,
                           agree.lib.mfx.sen.lowinfo,
                           agree.mod.mfx.sen.lowinfo,
                           agree.con.mfx.sen.lowinfo,
                           emoti.lib.mfx.sen.lowinfo,
                           emoti.mod.mfx.sen.lowinfo,
                           emoti.con.mfx.sen.lowinfo) 

mfx.frame.highinfo <- rbind(openn.lib.mfx.all.highinfo,                               
                            openn.mod.mfx.all.highinfo,
                            openn.con.mfx.all.highinfo,
                            consc.lib.mfx.all.highinfo,
                            consc.mod.mfx.all.highinfo, 
                            consc.con.mfx.all.highinfo, 
                            extra.lib.mfx.all.highinfo, 
                            extra.mod.mfx.all.highinfo, 
                            extra.con.mfx.all.highinfo, 
                            agree.lib.mfx.all.highinfo, 
                            agree.mod.mfx.all.highinfo, 
                            agree.con.mfx.all.highinfo, 
                            emoti.lib.mfx.all.highinfo, 
                            emoti.mod.mfx.all.highinfo, 
                            emoti.con.mfx.all.highinfo,
                            openn.lib.mfx.rep.highinfo,
                            openn.mod.mfx.rep.highinfo,
                            openn.con.mfx.rep.highinfo,
                            consc.lib.mfx.rep.highinfo,
                            consc.mod.mfx.rep.highinfo,
                            consc.con.mfx.rep.highinfo,
                            extra.lib.mfx.rep.highinfo,
                            extra.mod.mfx.rep.highinfo,
                            extra.con.mfx.rep.highinfo,
                            agree.lib.mfx.rep.highinfo,
                            agree.mod.mfx.rep.highinfo,
                            agree.con.mfx.rep.highinfo,
                            emoti.lib.mfx.rep.highinfo,
                            emoti.mod.mfx.rep.highinfo,
                            emoti.con.mfx.rep.highinfo,
                            openn.lib.mfx.sen.highinfo,
                            openn.mod.mfx.sen.highinfo,
                            openn.con.mfx.sen.highinfo,
                            consc.lib.mfx.sen.highinfo,
                            consc.mod.mfx.sen.highinfo,
                            consc.con.mfx.sen.highinfo,
                            extra.lib.mfx.sen.highinfo,
                            extra.mod.mfx.sen.highinfo,
                            extra.con.mfx.sen.highinfo,
                            agree.lib.mfx.sen.highinfo,
                            agree.mod.mfx.sen.highinfo,
                            agree.con.mfx.sen.highinfo,
                            emoti.lib.mfx.sen.highinfo,
                            emoti.mod.mfx.sen.highinfo,
                            emoti.con.mfx.sen.highinfo) 

# formatting the data frame
colnames(mfx.frame) <- c("Low", "Mid", "High", 
                         "Trait", "Ideology", 
                         "Office", "Response")
mfx.frame$Response <- factor(mfx.frame$Response, 
                             labels = c("Strongly Disapprove", 
                                        "Somewhat Disapprove", 
                                        "Somewhat Approve", 
                                        "Strongly Approve"))
mfx.frame$Trait <- factor(mfx.frame$Trait, 
                          labels = c("Openness", 
                                     "Conscientiousness", 
                                     "Extraversion", 
                                     "Agreeableness", 
                                     "Emotional Stability"))
mfx.frame$Ideology <- factor(mfx.frame$Ideology, 
                             labels = c("Liberal", 
                                        "Moderate", 
                                        "Conservative"))
mfx.frame$Office <- factor(mfx.frame$Office, 
                           labels = c("All Legislators", 
                                      "Representatives", 
                                      "Senators"))
mfx.frame$Ideology <- factor(mfx.frame$Ideology, 
                             levels = rev(levels(mfx.frame$Ideology)))
mfx.frame$Low <- as.numeric(as.character(mfx.frame$Low))
mfx.frame$Mid <- as.numeric(as.character(mfx.frame$Mid))
mfx.frame$High <- as.numeric(as.character(mfx.frame$High))


colnames(mfx.frame.copartisans) <- c("Low", "Mid", "High", 
                                     "Trait", "Ideology", 
                                     "Office", "Response")
mfx.frame.copartisans$Response <- factor(mfx.frame.copartisans$Response, 
                                         labels = c("Strongly Disapprove", 
                                                    "Somewhat Disapprove", 
                                                    "Somewhat Approve", 
                                                    "Strongly Approve"))
mfx.frame.copartisans$Trait <- factor(mfx.frame.copartisans$Trait, 
                                      labels = c("Openness", 
                                                 "Conscientiousness", 
                                                 "Extraversion", 
                                                 "Agreeableness", 
                                                 "Emotional Stability"))
mfx.frame.copartisans$Ideology <- factor(mfx.frame.copartisans$Ideology, 
                                         labels = c("Liberal", 
                                                    "Moderate", 
                                                    "Conservative"))
mfx.frame.copartisans$Office <- factor(mfx.frame.copartisans$Office, 
                                       labels = c("All Legislators", 
                                                  "Representatives", 
                                                  "Senators"))
mfx.frame.copartisans$Ideology <- factor(mfx.frame.copartisans$Ideology, 
                                         levels = rev(levels(mfx.frame.copartisans$Ideology)))
mfx.frame.copartisans$Low <- as.numeric(as.character(mfx.frame.copartisans$Low))
mfx.frame.copartisans$Mid <- as.numeric(as.character(mfx.frame.copartisans$Mid))
mfx.frame.copartisans$High <- as.numeric(as.character(mfx.frame.copartisans$High))


colnames(mfx.frame.nopartisans) <- c("Low", "Mid", "High", 
                                     "Trait", "Ideology", 
                                     "Office", "Response")
mfx.frame.nopartisans$Response <- factor(mfx.frame.nopartisans$Response, 
                                         labels = c("Strongly Disapprove", 
                                                    "Somewhat Disapprove", 
                                                    "Somewhat Approve", 
                                                    "Strongly Approve"))
mfx.frame.nopartisans$Trait <- factor(mfx.frame.nopartisans$Trait, 
                                      labels = c("Openness", 
                                                 "Conscientiousness", 
                                                 "Extraversion", 
                                                 "Agreeableness", 
                                                 "Emotional Stability"))
mfx.frame.nopartisans$Ideology <- factor(mfx.frame.nopartisans$Ideology, 
                                         labels = c("Liberal", 
                                                    "Moderate", 
                                                    "Conservative"))
mfx.frame.nopartisans$Office <- factor(mfx.frame.nopartisans$Office, 
                                       labels = c("All Legislators", 
                                                  "Representatives", 
                                                  "Senators"))
mfx.frame.nopartisans$Ideology <- factor(mfx.frame.nopartisans$Ideology, 
                                         levels = rev(levels(mfx.frame.nopartisans$Ideology)))
mfx.frame.nopartisans$Low <- as.numeric(as.character(mfx.frame.nopartisans$Low))
mfx.frame.nopartisans$Mid <- as.numeric(as.character(mfx.frame.nopartisans$Mid))
mfx.frame.nopartisans$High <- as.numeric(as.character(mfx.frame.nopartisans$High))


colnames(mfx.frame.lowinfo) <- c("Low", "Mid", "High", 
                                 "Trait", "Ideology", 
                                 "Office", "Response")
mfx.frame.lowinfo$Response <- factor(mfx.frame.lowinfo$Response, 
                                     labels = c("Strongly Disapprove", 
                                                "Somewhat Disapprove", 
                                                "Somewhat Approve", 
                                                "Strongly Approve"))
mfx.frame.lowinfo$Trait <- factor(mfx.frame.lowinfo$Trait, 
                                  labels = c("Openness", 
                                             "Conscientiousness", 
                                             "Extraversion", 
                                             "Agreeableness", 
                                             "Emotional Stability"))
mfx.frame.lowinfo$Ideology <- factor(mfx.frame.lowinfo$Ideology, 
                                     labels = c("Liberal", 
                                                "Moderate", 
                                                "Conservative"))
mfx.frame.lowinfo$Office <- factor(mfx.frame.lowinfo$Office, 
                                   labels = c("All Legislators", 
                                              "Representatives", 
                                              "Senators"))
mfx.frame.lowinfo$Ideology <- factor(mfx.frame.lowinfo$Ideology, 
                                     levels = rev(levels(mfx.frame.lowinfo$Ideology)))
mfx.frame.lowinfo$Low <- as.numeric(as.character(mfx.frame.lowinfo$Low))
mfx.frame.lowinfo$Mid <- as.numeric(as.character(mfx.frame.lowinfo$Mid))
mfx.frame.lowinfo$High <- as.numeric(as.character(mfx.frame.lowinfo$High))

colnames(mfx.frame.highinfo) <- c("Low", "Mid", "High", "Trait", 
                                  "Ideology", "Office", "Response")
mfx.frame.highinfo$Response <- factor(mfx.frame.highinfo$Response, 
                                      labels = c("Strongly Disapprove", 
                                                 "Somewhat Disapprove", 
                                                 "Somewhat Approve", 
                                                 "Strongly Approve"))
mfx.frame.highinfo$Trait <- factor(mfx.frame.highinfo$Trait, 
                                   labels = c("Openness", 
                                              "Conscientiousness", 
                                              "Extraversion", 
                                              "Agreeableness", 
                                              "Emotional Stability"))
mfx.frame.highinfo$Ideology <- factor(mfx.frame.highinfo$Ideology, 
                                      labels = c("Liberal", "Moderate", "Conservative"))
mfx.frame.highinfo$Office <- factor(mfx.frame.highinfo$Office, 
                                    labels = c("All Legislators", "Representatives", "Senators"))
mfx.frame.highinfo$Ideology <- factor(mfx.frame.highinfo$Ideology, 
                                      levels = rev(levels(mfx.frame.highinfo$Ideology)))
mfx.frame.highinfo$Low <- as.numeric(as.character(mfx.frame.highinfo$Low))
mfx.frame.highinfo$Mid <- as.numeric(as.character(mfx.frame.highinfo$Mid))
mfx.frame.highinfo$High <- as.numeric(as.character(mfx.frame.highinfo$High))

# making the actual plots
pred.plot.mfx <- ggplot(data.frame(mfx.frame), 
                        aes(x = Response, y = Mid, 
                            color = Ideology, 
                            shape = Ideology)) + 
  geom_point(position=position_dodge(width=0.5)) +
  geom_errorbar(aes(ymin = Low, ymax = High), 
                position=position_dodge(width=0.5), 
                width = 0.3) + 
  theme_bw() + 
  facet_grid(Office~Trait) + 
  ylab('\nPredicted Change in Probablity of Providing Given Response') + 
  xlab("Legislator Approval\n") + 
  coord_flip() + 
  scale_color_grey(guide = guide_legend(reverse = TRUE), 
                   name = "Respondent Ideology", 
                   start = 0, end = 0.8) + 
  scale_shape_discrete(guide = guide_legend(reverse = TRUE),
                       name = "Respondent Ideology") + 
  geom_hline(yintercept = 0, linetype = "dotted") + 
  theme(panel.margin = unit(0.8, "lines")) + 
  ylim(-0.5,0.5) + 
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

pred.plot.mfx.copartisans <- ggplot(data.frame(mfx.frame.copartisans), 
                                    aes(x = Response, y = Mid, 
                                        color = Ideology, 
                                        shape = Ideology)) + 
  geom_point(position=position_dodge(width=0.5)) +
  geom_errorbar(aes(ymin = Low, ymax = High), 
                position=position_dodge(width=0.5), 
                width = 0.3) + 
  theme_bw() + 
  facet_grid(Office~Trait) + 
  ylab('\nPredicted Change in Probablity of Providing Given Response') + 
  xlab("Legislator Approval\n") + 
  coord_flip() + 
  scale_color_grey(guide = guide_legend(reverse = TRUE), 
                   name = "Respondent Ideology", 
                   start = 0, end = 0.8) + 
  scale_shape_discrete(guide = guide_legend(reverse = TRUE),
                       name = "Respondent Ideology") + 
  geom_hline(yintercept = 0, linetype = "dotted") + 
  theme(panel.margin = unit(0.8, "lines")) + 
  ylim(-0.65,0.65) + 
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

pred.plot.mfx.nopartisans <- ggplot(data.frame(mfx.frame.nopartisans), 
                                    aes(x = Response, y = Mid, 
                                        color = Ideology, 
                                        shape = Ideology)) + 
  geom_point(position=position_dodge(width=0.5)) +
  geom_errorbar(aes(ymin = Low, ymax = High), 
                position=position_dodge(width=0.5), 
                width = 0.3) + 
  theme_bw() + 
  facet_grid(Office~Trait) + 
  ylab('\nPredicted Change in Probablity of Providing Given Response') + 
  xlab("Legislator Approval\n") + 
  coord_flip() + 
  scale_color_grey(guide = guide_legend(reverse = TRUE), 
                   name = "Respondent Ideology", 
                   start = 0, end = 0.8) + 
  scale_shape_discrete(guide = guide_legend(reverse = TRUE),
                       name = "Respondent Ideology") + 
  geom_hline(yintercept = 0, linetype = "dotted") + 
  theme(panel.margin = unit(0.8, "lines")) + 
  ylim(-0.55,0.55) + 
  theme(axis.text.x = element_text(angle = 45, hjust = 1))


pred.plot.mfx.lowinfo <- ggplot(data.frame(mfx.frame.lowinfo), 
                                aes(x = Response, y = Mid, 
                                    color = Ideology, 
                                    shape = Ideology)) + 
  geom_point(position=position_dodge(width=0.5)) +
  geom_errorbar(aes(ymin = Low, ymax = High), 
                position=position_dodge(width=0.5), 
                width = 0.3) + 
  theme_bw() + 
  facet_grid(Office~Trait) + 
  ylab('\nPredicted Change in Probablity of Providing Given Response') + 
  xlab("Legislator Approval\n") + 
  coord_flip() + 
  scale_color_grey(guide = guide_legend(reverse = TRUE), 
                   name = "Respondent Ideology", 
                   start = 0, end = 0.8) + 
  scale_shape_discrete(guide = guide_legend(reverse = TRUE),
                       name = "Respondent Ideology") + 
  geom_hline(yintercept = 0, linetype = "dotted") + 
  theme(panel.margin = unit(0.8, "lines")) + 
  ylim(-0.65,0.65) + 
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

pred.plot.mfx.highinfo <- ggplot(data.frame(mfx.frame.highinfo), 
                                 aes(x = Response, y = Mid, 
                                     color = Ideology, 
                                     shape = Ideology)) + 
  geom_point(position=position_dodge(width=0.5)) +
  geom_errorbar(aes(ymin = Low, ymax = High), 
                position=position_dodge(width=0.5), 
                width = 0.3) + 
  theme_bw() + 
  facet_grid(Office~Trait) + 
  ylab('\nPredicted Change in Probablity of Providing Given Response') + 
  xlab("Legislator Approval\n") + 
  coord_flip() + 
  scale_color_grey(guide = guide_legend(reverse = TRUE), 
                   name = "Respondent Ideology", 
                   start = 0, end = 0.8) + 
  scale_shape_discrete(guide = guide_legend(reverse = TRUE),
                       name = "Respondent Ideology") + 
  geom_hline(yintercept = 0, linetype = "dotted") + 
  theme(panel.margin = unit(0.8, "lines")) + 
  ylim(-0.55,0.55) + 
  theme(axis.text.x = element_text(angle = 45, hjust = 1))



ggsave(pred.plot.mfx,
       file = "Figure 4.pdf", 
       height = 6.5, width = 10)

ggsave(pred.plot.mfx.copartisans,
       file = "Figure E-1.pdf", 
       height = 6.5, width = 10)

ggsave(pred.plot.mfx.nopartisans,
       file = "Figure F-1.pdf", 
       height = 6.5, width = 10)

ggsave(pred.plot.mfx.lowinfo,
       file = "Figure G-1.pdf", 
       height = 6.5, width = 10)

ggsave(pred.plot.mfx.highinfo,
       file = "Figure H-1.pdf", 
       height = 6.5, width = 10)


# obama-specific functions
set.seed(1)

# write function to generate data frame and probabilities  
frame_gen_obama_mfx <- function(trait, ideo){  
  set.seed(1)
  # remove random effects
  newcoefs <- rmvnorm(100000, mean = coef(mod.obama.val.4.ordered), 
                              sigma = vcov(mod.obama.val.4.ordered)[-grep("ST",colnames(vcov(mod.obama.val.4.ordered))),
                                                                    -grep("ST",colnames(vcov(mod.obama.val.4.ordered)))])
  colnames(newcoefs) <- rownames(data.frame(mod.obama.val.4.ordered$coef))
  trait <- grep(trait, c("openn", "consc", "extra", "agree", "emoti"), ignore.case=TRUE, value=TRUE)
  b5.foo <- seq(mean(unlist(mod.obama.val.4.ordered$model[paste('obama_', trait, sep="")]), na.rm = TRUE) - 
                  sd(unlist(mod.obama.val.4.ordered$model[paste('obama_', trait, sep="")]), na.rm = TRUE),
                mean(unlist(mod.obama.val.4.ordered$model[paste('obama_', trait, sep="")]), na.rm = TRUE) + 
                  sd(unlist(mod.obama.val.4.ordered$model[paste('obama_', trait, sep="")]), na.rm = TRUE),
                length.out = 2) 
  ideo <- grep(ideo, c("Liberal","Moderate","Conservative"), ignore.case=TRUE, value=TRUE)
  ideosign <- ((-1)*(ideo == "Liberal")) + ((0)*(ideo == "Moderate")) + ((1)*(ideo == "Conservative"))
  pred.frame <- data.frame(matrix(NA, ncol = length(mod.obama.val.4.ordered$coef) - 3, 
                                             nrow = length(b5.foo)))
  colnames(pred.frame) <- rownames(data.frame(mod.obama.val.4.ordered$coef))[-c(1:3)]
  pred.frame['obama_openn'] <- mean(unlist(mod.obama.val.4.ordered$model['obama_openn']), na.rm = TRUE)
  pred.frame['obama_consc'] <- mean(unlist(mod.obama.val.4.ordered$model['obama_consc']), na.rm = TRUE)
  pred.frame['obama_extra'] <- mean(unlist(mod.obama.val.4.ordered$model['obama_extra']), na.rm = TRUE)
  pred.frame['obama_agree'] <- mean(unlist(mod.obama.val.4.ordered$model['obama_agree']), na.rm = TRUE)
  pred.frame['obama_emoti'] <- mean(unlist(mod.obama.val.4.ordered$model['obama_emoti']), na.rm = TRUE)
  pred.frame['scaled_info'] <- mean(unlist(mod.obama.val.4.ordered$model['scaled_info']), na.rm = TRUE)
  pred.frame[paste('obama_', trait, sep="")] <- b5.foo
  pred.frame['respondent_AM'] <- 
    0 + ideosign*sd(unlist(mod.obama.val.4.ordered$model['respondent_AM']), na.rm = TRUE)
  pred.frame['I(abs(respondent_AM))'] <- abs(pred.frame['respondent_AM'])
  pred.frame['I(abs(respondent_AM - obama_AM))'] <- 
    abs(pred.frame['respondent_AM'] - mean(newcces_16_merged$obama_AM, na.rm = TRUE))
  pred.frame['respondent_AM:obama_openn'] <- 
    pred.frame['respondent_AM']*pred.frame['obama_openn']
  pred.frame['respondent_AM:obama_consc'] <- 
    pred.frame['respondent_AM']*pred.frame['obama_consc']
  pred.frame['respondent_AM:obama_extra'] <- 
    pred.frame['respondent_AM']*pred.frame['obama_extra']
  pred.frame['respondent_AM:obama_agree'] <- 
    pred.frame['respondent_AM']*pred.frame['obama_agree']
  pred.frame['respondent_AM:obama_emoti'] <- 
    pred.frame['respondent_AM']*pred.frame['obama_emoti']
  pred.frame['I(abs(respondent_AM)):obama_openn'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['obama_openn']
  pred.frame['I(abs(respondent_AM)):obama_consc'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['obama_consc']
  pred.frame['I(abs(respondent_AM)):obama_extra'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['obama_extra']
  pred.frame['I(abs(respondent_AM)):obama_agree'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['obama_agree']
  pred.frame['I(abs(respondent_AM)):obama_emoti'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['obama_emoti']
  
  # predicted probabilities, with random effects marginalized out
  pred.xb <- t(as.matrix(pred.frame)%*%t(newcoefs[,-c(1:3)]))
  pred.xb1 <- newcoefs[,1] - pred.xb
  pred.xb2 <- newcoefs[,2] - pred.xb
  pred.xb3 <- newcoefs[,3] - pred.xb        
  pred.p1 <- plogis(pred.xb1)
  pred.p2 <- plogis(pred.xb2) - plogis(pred.xb1)
  pred.p3 <- plogis(pred.xb3) - plogis(pred.xb2)
  pred.p4 <- 1 - plogis(pred.xb3)
  pred.probs <- data.frame(cbind(pred.p1[,2] - pred.p1[,1],
                                 pred.p2[,2] - pred.p2[,1],
                                 pred.p3[,2] - pred.p3[,1],
                                 pred.p4[,2] - pred.p4[,1]))
  pred.probs <- t(apply(pred.probs,2,
                        quantile, c(0.05,0.5,0.95)))
  pred.probs <- data.frame(pred.probs,
                           trait,
                           ideo, 
                           outcome = 1:4,
                           row.names = NULL)
  return(pred.probs)
}      


openn.lib.mfx.obama <- frame_gen_obama_mfx("openn", "lib")                               
openn.mod.mfx.obama <- frame_gen_obama_mfx("openn", "mod")
openn.con.mfx.obama <- frame_gen_obama_mfx("openn", "con")
consc.lib.mfx.obama <- frame_gen_obama_mfx("consc", "lib")                               
consc.mod.mfx.obama <- frame_gen_obama_mfx("consc", "mod")
consc.con.mfx.obama <- frame_gen_obama_mfx("consc", "con")
extra.lib.mfx.obama <- frame_gen_obama_mfx("extra", "lib")                               
extra.mod.mfx.obama <- frame_gen_obama_mfx("extra", "mod")
extra.con.mfx.obama <- frame_gen_obama_mfx("extra", "con")
agree.lib.mfx.obama <- frame_gen_obama_mfx("agree", "lib")                               
agree.mod.mfx.obama <- frame_gen_obama_mfx("agree", "mod")
agree.con.mfx.obama <- frame_gen_obama_mfx("agree", "con")
emoti.lib.mfx.obama <- frame_gen_obama_mfx("emoti", "lib")                               
emoti.mod.mfx.obama <- frame_gen_obama_mfx("emoti", "mod")
emoti.con.mfx.obama <- frame_gen_obama_mfx("emoti", "con")

mfx.obama.frame <- rbind(openn.lib.mfx.obama,                               
                         openn.mod.mfx.obama,
                         openn.con.mfx.obama,
                         consc.lib.mfx.obama,
                         consc.mod.mfx.obama, 
                         consc.con.mfx.obama, 
                         extra.lib.mfx.obama, 
                         extra.mod.mfx.obama, 
                         extra.con.mfx.obama, 
                         agree.lib.mfx.obama, 
                         agree.mod.mfx.obama, 
                         agree.con.mfx.obama, 
                         emoti.lib.mfx.obama, 
                         emoti.mod.mfx.obama, 
                         emoti.con.mfx.obama) 

colnames(mfx.obama.frame) <- c("Low", "Mid", "High", "Trait", 
                               "Ideology", "Response")
mfx.obama.frame$Response <- factor(mfx.obama.frame$Response, 
                                   labels = c("Strongly Disapprove  ", 
                                              "Somewhat Disapprove  ", 
                                              "Somewhat Approve  ", 
                                              "Strongly Approve  "))
mfx.obama.frame$Trait <- factor(mfx.obama.frame$Trait, 
                                labels = c("Openness", 
                                           "Conscientiousness", 
                                           "Extraversion", 
                                           "Agreeableness", 
                                           "Emotional Stability"))
mfx.obama.frame$Ideology <- factor(mfx.obama.frame$Ideology, 
                                   labels = c("Liberal", "Moderate", "Conservative"))
mfx.obama.frame$Ideology <- factor(mfx.obama.frame$Ideology, 
                                   levels = rev(levels(mfx.obama.frame$Ideology)))
mfx.obama.frame$Low <- as.numeric(as.character(mfx.obama.frame$Low))
mfx.obama.frame$Mid <- as.numeric(as.character(mfx.obama.frame$Mid))
mfx.obama.frame$High <- as.numeric(as.character(mfx.obama.frame$High))

pred.plot.obama.mfx <- ggplot(data.frame(mfx.obama.frame), 
                        aes(x = Response, y = Mid, color = Ideology, 
                            shape = Ideology)) + 
  geom_point(position=position_dodge(width=0.5)) +
  geom_errorbar(aes(ymin = Low, ymax = High), 
                position=position_dodge(width=0.5), width = 0.3) + 
  theme_bw() + 
  ylab('\nPredicted Change in Probablity of Providing Given Response') + 
  xlab("Obama Approval\n") + 
  coord_flip() + 
  facet_wrap( ~ Trait, ncol = 5)+
  scale_color_grey(guide = guide_legend(reverse = TRUE), 
                   name = "Respondent Ideology", 
                   start = 0, end = 0.8) + 
  scale_shape_discrete(guide = guide_legend(reverse = TRUE),
                       name = "Respondent Ideology") + 
  geom_hline(yintercept = 0, linetype = "dotted") + 
  theme(panel.margin = unit(0.8, "lines")) + 
  ylim(-1,1) + 
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

ggsave(pred.plot.obama.mfx,
       file = "Figure C-2.pdf", 
       height = 4, width = 10)



# senator 2 models
set.seed(1)

# write function to generate data frame and probabilities  
frame_gen_sen2_mfx <- function(trait, ideo){   
  # marginalize over random effects
  newcoefs.sen2 <- rmvnorm(100000, mean = coef(mod.sen2.val.4.ordered), 
                           sigma = vcov(mod.sen2.val.4.ordered)[-grep("ST",colnames(vcov(mod.sen2.val.4.ordered))),
                                                                -grep("ST",colnames(vcov(mod.sen2.val.4.ordered)))])
  colnames(newcoefs.sen2) <- rownames(data.frame(mod.sen2.val.4.ordered$coef))
  trait <- grep(trait, c("openn", "consc", "extra", "agree", "emoti"), 
                ignore.case=TRUE, value=TRUE)
  ideo <- grep(ideo, c("Liberal","Moderate","Conservative"), 
               ignore.case=TRUE, value=TRUE)
  b5.foo <- seq(mean(unlist(mod.sen2.val.4.ordered$model[paste('cong_', trait, sep="")]), na.rm = TRUE) - 
                  sd(unlist(mod.sen2.val.4.ordered$model[paste('cong_', trait, sep="")]), na.rm = TRUE),
                mean(unlist(mod.sen2.val.4.ordered$model[paste('cong_', trait, sep="")]), na.rm = TRUE) + 
                  sd(unlist(mod.sen2.val.4.ordered$model[paste('cong_', trait, sep="")]), na.rm = TRUE),
                length.out = 2) 
  ideosign <- ((-1)*(ideo == "Liberal")) + ((0)*(ideo == "Moderate")) + ((1)*(ideo == "Conservative"))
  pred.frame <- data.frame(matrix(NA, ncol = length(mod.sen2.val.4.ordered$coef) - 3,
                                  nrow = length(b5.foo)))
  colnames(pred.frame) <- rownames(data.frame(mod.sen2.val.4.ordered$coef))[-c(1:3)]
  pred.frame['cong_openn'] <- mean(as.matrix(mod.sen2.val.4.ordered$model['cong_openn']))
  pred.frame['cong_consc'] <- mean(as.matrix(mod.sen2.val.4.ordered$model['cong_consc']))
  pred.frame['cong_extra'] <- mean(as.matrix(mod.sen2.val.4.ordered$model['cong_extra']))
  pred.frame['cong_agree'] <- mean(as.matrix(mod.sen2.val.4.ordered$model['cong_agree']))
  pred.frame['cong_emoti'] <- mean(as.matrix(mod.sen2.val.4.ordered$model['cong_emoti']))
  pred.frame['scaled_info'] <- mean(as.matrix(mod.sen2.val.4.ordered$model['scaled_info']))
  pred.frame[paste('cong_', trait, sep="")] <- b5.foo
  pred.frame['respondent_AM'] <- 
    0 + ideosign*sd(unlist(mod.sen2.val.4.ordered$model['respondent_AM']), na.rm = TRUE)
  pred.frame['I(abs(respondent_AM))'] <- abs(pred.frame['respondent_AM'])
  pred.frame['I(abs(respondent_AM - cong_AM))'] <- 
    abs(pred.frame['respondent_AM'] - 
          mean(cces14.sen2$cong_AM, na.rm = TRUE))
  pred.frame['respondent_AM:cong_openn'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_openn']
  pred.frame['respondent_AM:cong_consc'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_consc']
  pred.frame['respondent_AM:cong_extra'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_extra']
  pred.frame['respondent_AM:cong_agree'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_agree']
  pred.frame['respondent_AM:cong_emoti'] <- 
    pred.frame['respondent_AM']*pred.frame['cong_emoti']
  pred.frame['I(abs(respondent_AM)):cong_openn'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_openn']
  pred.frame['I(abs(respondent_AM)):cong_consc'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_consc']
  pred.frame['I(abs(respondent_AM)):cong_extra'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_extra']
  pred.frame['I(abs(respondent_AM)):cong_agree'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_agree']
  pred.frame['I(abs(respondent_AM)):cong_emoti'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['cong_emoti']
  
  # predicted probabilities, with random effects marginalized out
  pred.xb <- t(as.matrix(pred.frame)%*%t(newcoefs[,-c(1:3)]))
  pred.xb1 <- newcoefs[,1] - pred.xb
  pred.xb2 <- newcoefs[,2] - pred.xb
  pred.xb3 <- newcoefs[,3] - pred.xb        
  pred.p1 <- plogis(pred.xb1)
  pred.p2 <- plogis(pred.xb2) - plogis(pred.xb1)
  pred.p3 <- plogis(pred.xb3) - plogis(pred.xb2)
  pred.p4 <- 1 - plogis(pred.xb3)
  pred.probs <- data.frame(cbind(pred.p1[,2] - pred.p1[,1],
                                 pred.p2[,2] - pred.p2[,1],
                                 pred.p3[,2] - pred.p3[,1],
                                 pred.p4[,2] - pred.p4[,1]))
  pred.probs <- t(apply(pred.probs, 2,
                        quantile, c(0.05,0.5,0.95)))
  pred.probs <- data.frame(pred.probs,
                           trait,
                           ideo, 
                           outcome = 1:4,
                           row.names = NULL)
  return(pred.probs)
}      

# create data frames
openn.lib.mfx.sen2 <- frame_gen_sen2_mfx("openn", "lib")                               
openn.mod.mfx.sen2 <- frame_gen_sen2_mfx("openn", "mod")
openn.con.mfx.sen2 <- frame_gen_sen2_mfx("openn", "con")
consc.lib.mfx.sen2 <- frame_gen_sen2_mfx("consc", "lib")                               
consc.mod.mfx.sen2 <- frame_gen_sen2_mfx("consc", "mod")
consc.con.mfx.sen2 <- frame_gen_sen2_mfx("consc", "con")
extra.lib.mfx.sen2 <- frame_gen_sen2_mfx("extra", "lib")                               
extra.mod.mfx.sen2 <- frame_gen_sen2_mfx("extra", "mod")
extra.con.mfx.sen2 <- frame_gen_sen2_mfx("extra", "con")
agree.lib.mfx.sen2 <- frame_gen_sen2_mfx("agree", "lib")                               
agree.mod.mfx.sen2 <- frame_gen_sen2_mfx("agree", "mod")
agree.con.mfx.sen2 <- frame_gen_sen2_mfx("agree", "con")
emoti.lib.mfx.sen2 <- frame_gen_sen2_mfx("emoti", "lib")                               
emoti.mod.mfx.sen2 <- frame_gen_sen2_mfx("emoti", "mod")
emoti.con.mfx.sen2 <- frame_gen_sen2_mfx("emoti", "con")

mfx.sen2.frame <- rbind(openn.lib.mfx.sen2,                               
                        openn.mod.mfx.sen2,
                        openn.con.mfx.sen2,
                        consc.lib.mfx.sen2,
                        consc.mod.mfx.sen2, 
                        consc.con.mfx.sen2, 
                        extra.lib.mfx.sen2, 
                        extra.mod.mfx.sen2, 
                        extra.con.mfx.sen2, 
                        agree.lib.mfx.sen2, 
                        agree.mod.mfx.sen2, 
                        agree.con.mfx.sen2, 
                        emoti.lib.mfx.sen2, 
                        emoti.mod.mfx.sen2, 
                        emoti.con.mfx.sen2) 

# format data frames
colnames(mfx.sen2.frame) <- c("Low", "Mid", "High", 
                              "Trait", "Ideology", "Response")
mfx.sen2.frame$Response <- factor(mfx.sen2.frame$Response, 
                                  labels = c("Strongly Disapprove  ", 
                                             "Somewhat Disapprove  ", 
                                             "Somewhat Approve  ", 
                                             "Strongly Approve  "))
mfx.sen2.frame$Trait <- factor(mfx.sen2.frame$Trait, 
                               labels = c("Openness", 
                                          "Conscientiousness", 
                                          "Extraversion", 
                                          "Agreeableness", 
                                          "Emotional Stability"))
mfx.sen2.frame$Ideology <- factor(mfx.sen2.frame$Ideology, 
                                  labels = c("Liberal", 
                                             "Moderate", 
                                             "Conservative"))
mfx.sen2.frame$Ideology <- factor(mfx.sen2.frame$Ideology, 
                                  levels = rev(levels(mfx.sen2.frame$Ideology)))
mfx.sen2.frame$Low <- as.numeric(as.character(mfx.sen2.frame$Low))
mfx.sen2.frame$Mid <- as.numeric(as.character(mfx.sen2.frame$Mid))
mfx.sen2.frame$High <- as.numeric(as.character(mfx.sen2.frame$High))


pred.plot.sen2.mfx <- ggplot(data.frame(mfx.sen2.frame), 
                             aes(x = Response, y = Mid, color = Ideology, 
                                 shape = Ideology)) + 
  geom_point(position=position_dodge(width=0.5)) +
  geom_errorbar(aes(ymin = Low, ymax = High), 
                position=position_dodge(width=0.5), 
                width = 0.3) + 
  theme_bw() + 
  ylab('\nPredicted Change in Probablity of Providing Given Response') + 
  xlab("Senator Approval\n") + 
  coord_flip() + 
  facet_wrap( ~ Trait, ncol = 5)+
  scale_color_grey(guide = guide_legend(reverse = TRUE), 
                   name = "Respondent Ideology", 
                   start = 0, end = 0.8) + 
  scale_shape_discrete(guide = guide_legend(reverse = TRUE),
                       name = "Respondent Ideology") + 
  geom_hline(yintercept = 0, linetype = "dotted") + 
  theme(panel.margin = unit(0.8, "lines")) + 
  ylim(-.5,.5) + 
  theme(axis.text.x = element_text(angle = 45, hjust = 1))


ggsave(pred.plot.sen2.mfx,
       file = "Figure D-2.pdf", 
       height = 4, width = 10)








#### Plots for relative approval

set.seed(1)

# write function to generate data frame and probabilities  
frame_gen_rel_mfx <- function(trait, ideo){    
  newcoefs.relative <- rmvnorm(100000, mean = coef(relative.val.mod.4), 
                               sigma = vcov(relative.val.mod.4)[-grep("ST",colnames(vcov(relative.val.mod.4))),
                                                                -grep("ST",colnames(vcov(relative.val.mod.4)))])
  colnames(newcoefs.relative) <- rownames(data.frame(relative.val.mod.4$coef))
  trait <- grep(trait, c("openn", "consc", "extra", "agree", "emoti"), ignore.case=TRUE, value=TRUE)
  ideo <- grep(ideo, c("Liberal","Moderate","Conservative"), ignore.case=TRUE, value=TRUE)
  ideosign <- ((-1)*(ideo == "Liberal")) + ((0)*(ideo == "Moderate")) + ((1)*(ideo == "Conservative"))
  pred.frame <- data.frame(matrix(NA, ncol = length(relative.val.mod.4$coef) - 2, nrow = 2))
  colnames(pred.frame) <- rownames(data.frame(relative.val.mod.4$coef))[-c(1:2)]
  pred.frame['I(sen2_openn - sen1_openn)'] <- 0
  pred.frame['I(sen2_consc - sen1_consc)'] <- 0
  pred.frame['I(sen2_extra - sen1_extra)'] <- 0
  pred.frame['I(sen2_agree - sen1_agree)'] <- 0
  pred.frame['I(sen2_emoti - sen1_emoti)'] <- 0
  pred.frame['scaled_info'] <- mean(as.matrix(relative.val.mod.4$model['scaled_info']))
  pred.frame[paste('I(sen2_', trait, ' - sen1_', trait, ')', sep="")] <- c(-1, 1)
  pred.frame['respondent_AM'] <- 
    0 + ideosign*sd(as.matrix(relative.val.mod.4$model['respondent_AM']))
  pred.frame['I(abs(respondent_AM))'] <- abs(pred.frame['respondent_AM'])
  pred.frame['I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM))'] <- 0
  pred.frame['respondent_AM:I(sen2_openn - sen1_openn)'] <- 
    pred.frame['respondent_AM']*pred.frame['I(sen2_openn - sen1_openn)']
  pred.frame['respondent_AM:I(sen2_consc - sen1_consc)'] <- 
    pred.frame['respondent_AM']*pred.frame['I(sen2_consc - sen1_consc)']
  pred.frame['respondent_AM:I(sen2_extra - sen1_extra)'] <- 
    pred.frame['respondent_AM']*pred.frame['I(sen2_extra - sen1_extra)']
  pred.frame['respondent_AM:I(sen2_agree - sen1_agree)'] <- 
    pred.frame['respondent_AM']*pred.frame['I(sen2_agree - sen1_agree)']
  pred.frame['respondent_AM:I(sen2_emoti - sen1_emoti)'] <- 
    pred.frame['respondent_AM']*pred.frame['I(sen2_emoti - sen1_emoti)']
  pred.frame['I(abs(respondent_AM)):I(sen2_openn - sen1_openn)'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['I(sen2_openn - sen1_openn)']
  pred.frame['I(abs(respondent_AM)):I(sen2_consc - sen1_consc)'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['I(sen2_consc - sen1_consc)']
  pred.frame['I(abs(respondent_AM)):I(sen2_extra - sen1_extra)'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['I(sen2_extra - sen1_extra)']
  pred.frame['I(abs(respondent_AM)):I(sen2_agree - sen1_agree)'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['I(sen2_agree - sen1_agree)']
  pred.frame['I(abs(respondent_AM)):I(sen2_emoti - sen1_emoti)'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['I(sen2_emoti - sen1_emoti)']
  
  # predicted probabilities, with random effects marginalized out
  pred.xb <- t(as.matrix(pred.frame)%*%t(newcoefs.relative[,-c(1:2)]))
  pred.xb1 <- newcoefs.relative[,1] - pred.xb
  pred.xb2 <- newcoefs.relative[,2] - pred.xb
  pred.p1 <- plogis(pred.xb1)
  pred.p2 <- plogis(pred.xb2) - plogis(pred.xb1)
  pred.p3 <- 1 - plogis(pred.xb2)
  pred.probs <- data.frame(rbind(quantile(pred.p1[,2] - pred.p1[,1], 
                                          c(0.05, 0.5, 0.95)),
                                 quantile(pred.p2[,2] - pred.p2[,1], 
                                          c(0.05, 0.5, 0.95)),
                                 quantile(pred.p3[,2] - pred.p3[,1], 
                                          c(0.05, 0.5, 0.95))),
                           trait, ideo, Response = 1:3)
  return(pred.probs)
}                              


# write function to generate data frame and probabilities  
frame_gen_rel_mfx_lowinfo <- function(trait, ideo){   
  newcoefs.relative.lowinfo <- rmvnorm(100000, 
                                       mean = coef(relative.val.mod.4.lowinfo), 
                                       sigma = vcov(relative.val.mod.4.lowinfo)[-grep("ST",colnames(vcov(relative.val.mod.4.lowinfo))),
                                                                                -grep("ST",colnames(vcov(relative.val.mod.4.lowinfo)))])
  colnames(newcoefs.relative.lowinfo) <- rownames(data.frame(relative.val.mod.4.lowinfo$coef))
  trait <- grep(trait, c("openn", "consc", "extra", "agree", "emoti"), ignore.case=TRUE, value=TRUE)
  ideo <- grep(ideo, c("Liberal","Moderate","Conservative"), ignore.case=TRUE, value=TRUE)
  ideosign <- ((-1)*(ideo == "Liberal")) + ((0)*(ideo == "Moderate")) + ((1)*(ideo == "Conservative"))
  pred.frame <- data.frame(matrix(NA, ncol = length(relative.val.mod.4.lowinfo$coef) - 2, nrow = 2))
  colnames(pred.frame) <- rownames(data.frame(relative.val.mod.4.lowinfo$coef))[-c(1:2)]
  pred.frame['I(sen2_openn - sen1_openn)'] <- 0
  pred.frame['I(sen2_consc - sen1_consc)'] <- 0
  pred.frame['I(sen2_extra - sen1_extra)'] <- 0
  pred.frame['I(sen2_agree - sen1_agree)'] <- 0
  pred.frame['I(sen2_emoti - sen1_emoti)'] <- 0
  pred.frame['scaled_info'] <- mean(as.matrix(relative.val.mod.4.lowinfo$model['scaled_info']))
  pred.frame[paste('I(sen2_', trait, ' - sen1_', trait, ')', sep="")] <- c(-1, 1)
  pred.frame['respondent_AM'] <- 
    0 + ideosign*sd(as.matrix(relative.val.mod.4.lowinfo$model['respondent_AM']))
  pred.frame['I(abs(respondent_AM))'] <- abs(pred.frame['respondent_AM'])
  pred.frame['I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM))'] <- 0
  pred.frame['respondent_AM:I(sen2_openn - sen1_openn)'] <- 
    pred.frame['respondent_AM']*pred.frame['I(sen2_openn - sen1_openn)']
  pred.frame['respondent_AM:I(sen2_consc - sen1_consc)'] <- 
    pred.frame['respondent_AM']*pred.frame['I(sen2_consc - sen1_consc)']
  pred.frame['respondent_AM:I(sen2_extra - sen1_extra)'] <- 
    pred.frame['respondent_AM']*pred.frame['I(sen2_extra - sen1_extra)']
  pred.frame['respondent_AM:I(sen2_agree - sen1_agree)'] <- 
    pred.frame['respondent_AM']*pred.frame['I(sen2_agree - sen1_agree)']
  pred.frame['respondent_AM:I(sen2_emoti - sen1_emoti)'] <- 
    pred.frame['respondent_AM']*pred.frame['I(sen2_emoti - sen1_emoti)']
  pred.frame['I(abs(respondent_AM)):I(sen2_openn - sen1_openn)'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['I(sen2_openn - sen1_openn)']
  pred.frame['I(abs(respondent_AM)):I(sen2_consc - sen1_consc)'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['I(sen2_consc - sen1_consc)']
  pred.frame['I(abs(respondent_AM)):I(sen2_extra - sen1_extra)'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['I(sen2_extra - sen1_extra)']
  pred.frame['I(abs(respondent_AM)):I(sen2_agree - sen1_agree)'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['I(sen2_agree - sen1_agree)']
  pred.frame['I(abs(respondent_AM)):I(sen2_emoti - sen1_emoti)'] <- 
    pred.frame['I(abs(respondent_AM))']*pred.frame['I(sen2_emoti - sen1_emoti)']
  
  # predicted probabilities, with random effects marginalized out
  pred.xb <- t(as.matrix(pred.frame)%*%t(newcoefs.relative.lowinfo[,-c(1:2)]))
  pred.xb1 <- newcoefs.relative.lowinfo[,1] - pred.xb
  pred.xb2 <- newcoefs.relative.lowinfo[,2] - pred.xb
  pred.p1 <- plogis(pred.xb1)
  pred.p2 <- plogis(pred.xb2) - plogis(pred.xb1)
  pred.p3 <- 1 - plogis(pred.xb2)
  pred.probs <- data.frame(rbind(quantile(pred.p1[,2] - pred.p1[,1], 
                                          c(0.05, 0.5, 0.95)),
                                 quantile(pred.p2[,2] - pred.p2[,1], 
                                          c(0.05, 0.5, 0.95)),
                                 quantile(pred.p3[,2] - pred.p3[,1], 
                                          c(0.05, 0.5, 0.95))),
                           trait, ideo, Response = 1:3)
  return(pred.probs)
}                              


# write function to generate data frame and probabilities  
frame_gen_rel_mfx_highinfo <- function(trait, ideo){  
  newcoefs.relative.highinfo <- rmvnorm(100000, 
                                        mean = coef(relative.val.mod.4.highinfo), 
                                        sigma = vcov(relative.val.mod.4.highinfo)[-grep("ST",colnames(vcov(relative.val.mod.4.highinfo))),
                                                                                  -grep("ST",colnames(vcov(relative.val.mod.4.highinfo)))])
  colnames(newcoefs.relative.highinfo) <- rownames(data.frame(relative.val.mod.4.highinfo$coef))
  trait <- grep(trait, c("openn", "consc", "extra", "agree", "emoti"), ignore.case=TRUE, value=TRUE)
  ideo <- grep(ideo, c("Liberal","Moderate","Conservative"), ignore.case=TRUE, value=TRUE)
  ideosign <- ((-1)*(ideo == "Liberal")) + ((0)*(ideo == "Moderate")) + ((1)*(ideo == "Conservative"))
  pred.frame <- data.frame(matrix(NA, ncol = length(relative.val.mod.4.highinfo$coef) - 2, nrow = 2))
  colnames(pred.frame) <- rownames(data.frame(relative.val.mod.4.highinfo$coef))[-c(1:2)]
  pred.frame['I(sen2_openn - sen1_openn)'] <- 0
  pred.frame['I(sen2_consc - sen1_consc)'] <- 0
  pred.frame['I(sen2_extra - sen1_extra)'] <- 0
  pred.frame['I(sen2_agree - sen1_agree)'] <- 0
  pred.frame['I(sen2_emoti - sen1_emoti)'] <- 0
  pred.frame['scaled_info'] <- mean(as.matrix(relative.val.mod.4.highinfo$model['scaled_info']))
  pred.frame[paste('I(sen2_', trait, ' - sen1_', trait, ')', sep="")] <- c(-1, 1)
  pred.frame['respondent_AM'] <- 
    0 + ideosign*sd(as.matrix(relative.val.mod.4.highinfo$model['respondent_AM']))
  pred.frame['I(abs(respondent_AM))'] <- abs(pred.frame['respondent_AM'])
  pred.frame['I(abs(respondent_AM - sen1_AM) - abs(respondent_AM - sen2_AM))'] <- 0
  pred.frame['respondent_AM:I(sen2_openn - sen1_openn)'] <- 
    pred.frame['respondent_AM']*pred.frame['I(sen2_openn - sen1_openn)']
  pred.frame['respondent_AM:I(sen2_consc - sen1_consc)'] <- 
    pred.frame['respondent_AM']*pred.frame['I(sen2_consc - sen1_consc)']
  pred.frame['respondent_AM:I(sen2_extra - sen1_extra)'] <- 
    pred.frame['respondent_AM']*pred.frame['I(sen2_extra - sen1_extra)']
  pred.frame['respondent_AM:I(sen2_agree - sen1_agree)'] <- 
    pred.frame['respondent_AM']*pred.frame['I(sen2_agree - sen1_agree)']
  pred.frame['respondent_AM:I(sen2_emoti - sen1_emoti)'] <- 
    pred.frame['respondent_AM']*pred.frame['I(sen2_emoti - sen1_emoti)']
  pred.frame['I(abs(respondent_AM)):I(sen2_openn - sen1_openn)'] <-
    pred.frame['I(abs(respondent_AM))']*pred.frame['I(sen2_openn - sen1_openn)']
  pred.frame['I(abs(respondent_AM)):I(sen2_consc - sen1_consc)'] <-
    pred.frame['I(abs(respondent_AM))']*pred.frame['I(sen2_consc - sen1_consc)']
  pred.frame['I(abs(respondent_AM)):I(sen2_extra - sen1_extra)'] <-
    pred.frame['I(abs(respondent_AM))']*pred.frame['I(sen2_extra - sen1_extra)']
  pred.frame['I(abs(respondent_AM)):I(sen2_agree - sen1_agree)'] <-
    pred.frame['I(abs(respondent_AM))']*pred.frame['I(sen2_agree - sen1_agree)']
  pred.frame['I(abs(respondent_AM)):I(sen2_emoti - sen1_emoti)'] <-
    pred.frame['I(abs(respondent_AM))']*pred.frame['I(sen2_emoti - sen1_emoti)']
  
  # predicted probabilities, with random effects marginalized out
  pred.xb <- t(as.matrix(pred.frame)%*%t(newcoefs.relative.highinfo[,-c(1:2)]))
  pred.xb1 <- newcoefs.relative.highinfo[,1] - pred.xb
  pred.xb2 <- newcoefs.relative.highinfo[,2] - pred.xb
  pred.p1 <- plogis(pred.xb1)
  pred.p2 <- plogis(pred.xb2) - plogis(pred.xb1)
  pred.p3 <- 1 - plogis(pred.xb2)
  pred.probs <- data.frame(rbind(quantile(pred.p1[,2] - pred.p1[,1], 
                                          c(0.05, 0.5, 0.95)),
                                 quantile(pred.p2[,2] - pred.p2[,1], 
                                          c(0.05, 0.5, 0.95)),
                                 quantile(pred.p3[,2] - pred.p3[,1], 
                                          c(0.05, 0.5, 0.95))),
                           trait, ideo, Response = 1:3)
  return(pred.probs)
}                              

# generate marginal effects
openn.rel.lib.mfx <- frame_gen_rel_mfx("openn", "lib")                               
openn.rel.mod.mfx <- frame_gen_rel_mfx("openn", "mod")
openn.rel.con.mfx <- frame_gen_rel_mfx("openn", "con")
consc.rel.lib.mfx <- frame_gen_rel_mfx("consc", "lib")                               
consc.rel.mod.mfx <- frame_gen_rel_mfx("consc", "mod")
consc.rel.con.mfx <- frame_gen_rel_mfx("consc", "con")
extra.rel.lib.mfx <- frame_gen_rel_mfx("extra", "lib")                               
extra.rel.mod.mfx <- frame_gen_rel_mfx("extra", "mod")
extra.rel.con.mfx <- frame_gen_rel_mfx("extra", "con")
agree.rel.lib.mfx <- frame_gen_rel_mfx("agree", "lib")                               
agree.rel.mod.mfx <- frame_gen_rel_mfx("agree", "mod")
agree.rel.con.mfx <- frame_gen_rel_mfx("agree", "con")
emoti.rel.lib.mfx <- frame_gen_rel_mfx("emoti", "lib")                               
emoti.rel.mod.mfx <- frame_gen_rel_mfx("emoti", "mod")
emoti.rel.con.mfx <- frame_gen_rel_mfx("emoti", "con")

openn.rel.lib.mfx.lowinfo <- frame_gen_rel_mfx_lowinfo("openn", "lib")                               
openn.rel.mod.mfx.lowinfo <- frame_gen_rel_mfx_lowinfo("openn", "mod")
openn.rel.con.mfx.lowinfo <- frame_gen_rel_mfx_lowinfo("openn", "con")
consc.rel.lib.mfx.lowinfo <- frame_gen_rel_mfx_lowinfo("consc", "lib")                               
consc.rel.mod.mfx.lowinfo <- frame_gen_rel_mfx_lowinfo("consc", "mod")
consc.rel.con.mfx.lowinfo <- frame_gen_rel_mfx_lowinfo("consc", "con")
extra.rel.lib.mfx.lowinfo <- frame_gen_rel_mfx_lowinfo("extra", "lib")                               
extra.rel.mod.mfx.lowinfo <- frame_gen_rel_mfx_lowinfo("extra", "mod")
extra.rel.con.mfx.lowinfo <- frame_gen_rel_mfx_lowinfo("extra", "con")
agree.rel.lib.mfx.lowinfo <- frame_gen_rel_mfx_lowinfo("agree", "lib")                               
agree.rel.mod.mfx.lowinfo <- frame_gen_rel_mfx_lowinfo("agree", "mod")
agree.rel.con.mfx.lowinfo <- frame_gen_rel_mfx_lowinfo("agree", "con")
emoti.rel.lib.mfx.lowinfo <- frame_gen_rel_mfx_lowinfo("emoti", "lib")                               
emoti.rel.mod.mfx.lowinfo <- frame_gen_rel_mfx_lowinfo("emoti", "mod")
emoti.rel.con.mfx.lowinfo <- frame_gen_rel_mfx_lowinfo("emoti", "con")

openn.rel.lib.mfx.highinfo <- frame_gen_rel_mfx_highinfo("openn", "lib")                               
openn.rel.mod.mfx.highinfo <- frame_gen_rel_mfx_highinfo("openn", "mod")
openn.rel.con.mfx.highinfo <- frame_gen_rel_mfx_highinfo("openn", "con")
consc.rel.lib.mfx.highinfo <- frame_gen_rel_mfx_highinfo("consc", "lib")                               
consc.rel.mod.mfx.highinfo <- frame_gen_rel_mfx_highinfo("consc", "mod")
consc.rel.con.mfx.highinfo <- frame_gen_rel_mfx_highinfo("consc", "con")
extra.rel.lib.mfx.highinfo <- frame_gen_rel_mfx_highinfo("extra", "lib")                               
extra.rel.mod.mfx.highinfo <- frame_gen_rel_mfx_highinfo("extra", "mod")
extra.rel.con.mfx.highinfo <- frame_gen_rel_mfx_highinfo("extra", "con")
agree.rel.lib.mfx.highinfo <- frame_gen_rel_mfx_highinfo("agree", "lib")                               
agree.rel.mod.mfx.highinfo <- frame_gen_rel_mfx_highinfo("agree", "mod")
agree.rel.con.mfx.highinfo <- frame_gen_rel_mfx_highinfo("agree", "con")
emoti.rel.lib.mfx.highinfo <- frame_gen_rel_mfx_highinfo("emoti", "lib")                               
emoti.rel.mod.mfx.highinfo <- frame_gen_rel_mfx_highinfo("emoti", "mod")
emoti.rel.con.mfx.highinfo <- frame_gen_rel_mfx_highinfo("emoti", "con")


# put together data frames
rel.mfx.frame <- rbind(openn.rel.lib.mfx,                               
                       openn.rel.mod.mfx,
                       openn.rel.con.mfx,
                       consc.rel.lib.mfx,
                       consc.rel.mod.mfx, 
                       consc.rel.con.mfx, 
                       extra.rel.lib.mfx, 
                       extra.rel.mod.mfx, 
                       extra.rel.con.mfx, 
                       agree.rel.lib.mfx, 
                       agree.rel.mod.mfx, 
                       agree.rel.con.mfx, 
                       emoti.rel.lib.mfx, 
                       emoti.rel.mod.mfx, 
                       emoti.rel.con.mfx) 

rel.mfx.frame.lowinfo <- rbind(openn.rel.lib.mfx.lowinfo,                               
                               openn.rel.mod.mfx.lowinfo,
                               openn.rel.con.mfx.lowinfo,
                               consc.rel.lib.mfx.lowinfo,
                               consc.rel.mod.mfx.lowinfo, 
                               consc.rel.con.mfx.lowinfo, 
                               extra.rel.lib.mfx.lowinfo, 
                               extra.rel.mod.mfx.lowinfo, 
                               extra.rel.con.mfx.lowinfo, 
                               agree.rel.lib.mfx.lowinfo, 
                               agree.rel.mod.mfx.lowinfo, 
                               agree.rel.con.mfx.lowinfo, 
                               emoti.rel.lib.mfx.lowinfo, 
                               emoti.rel.mod.mfx.lowinfo, 
                               emoti.rel.con.mfx.lowinfo)

rel.mfx.frame.highinfo <- rbind(openn.rel.lib.mfx.highinfo,                               
                                openn.rel.mod.mfx.highinfo,
                                openn.rel.con.mfx.highinfo,
                                consc.rel.lib.mfx.highinfo,
                                consc.rel.mod.mfx.highinfo, 
                                consc.rel.con.mfx.highinfo, 
                                extra.rel.lib.mfx.highinfo, 
                                extra.rel.mod.mfx.highinfo, 
                                extra.rel.con.mfx.highinfo, 
                                agree.rel.lib.mfx.highinfo, 
                                agree.rel.mod.mfx.highinfo, 
                                agree.rel.con.mfx.highinfo, 
                                emoti.rel.lib.mfx.highinfo, 
                                emoti.rel.mod.mfx.highinfo, 
                                emoti.rel.con.mfx.highinfo)

# format data frames                         
colnames(rel.mfx.frame) <- c("Low", "Mid", "High", 
                             "Trait", "Ideology", "Response")
rel.mfx.frame$Response <- factor(rel.mfx.frame$Response, 
                                 labels = c("Approve More of Senator 1  ", 
                                            "Approve Equally  ", 
                                            "Approve More of Senator 2  "))
rel.mfx.frame$Trait <- factor(rel.mfx.frame$Trait, 
                              labels = c("Openness", 
                                         "Conscientiousness", 
                                         "Extraversion", 
                                         "Agreeableness", 
                                         "Emotional Stability"))
rel.mfx.frame$Ideology <- factor(rel.mfx.frame$Ideology, 
                                 labels = c("Liberal", "Moderate", "Conservative"))
rel.mfx.frame$Ideology <- factor(rel.mfx.frame$Ideology, 
                                 levels = rev(levels(rel.mfx.frame$Ideology)))
rel.mfx.frame$Response <- factor(rel.mfx.frame$Response, 
                                 levels = rev(levels(rel.mfx.frame$Response)))
rel.mfx.frame$Low <- as.numeric(as.character(rel.mfx.frame$Low))
rel.mfx.frame$Mid <- as.numeric(as.character(rel.mfx.frame$Mid))
rel.mfx.frame$High <- as.numeric(as.character(rel.mfx.frame$High))

colnames(rel.mfx.frame.lowinfo) <- c("Low", "Mid", "High", 
                                     "Trait", "Ideology", "Response")
rel.mfx.frame.lowinfo$Response <- factor(rel.mfx.frame.lowinfo$Response, 
                                         labels = c("Approve More of Senator 1  ", 
                                                    "Approve Equally  ", 
                                                    "Approve More of Senator 2  "))
rel.mfx.frame.lowinfo$Trait <- factor(rel.mfx.frame.lowinfo$Trait, 
                                      labels = c("Openness", 
                                                 "Conscientiousness", 
                                                 "Extraversion", 
                                                 "Agreeableness", 
                                                 "Emotional Stability"))
rel.mfx.frame.lowinfo$Ideology <- factor(rel.mfx.frame.lowinfo$Ideology, 
                                         labels = c("Liberal", 
                                                    "Moderate", 
                                                    "Conservative"))
rel.mfx.frame.lowinfo$Ideology <- factor(rel.mfx.frame.lowinfo$Ideology, 
                                         levels = rev(levels(rel.mfx.frame.lowinfo$Ideology)))
rel.mfx.frame.lowinfo$Response <- factor(rel.mfx.frame.lowinfo$Response, 
                                         levels = rev(levels(rel.mfx.frame.lowinfo$Response)))
rel.mfx.frame.lowinfo$Low <- as.numeric(as.character(rel.mfx.frame.lowinfo$Low))
rel.mfx.frame.lowinfo$Mid <- as.numeric(as.character(rel.mfx.frame.lowinfo$Mid))
rel.mfx.frame.lowinfo$High <- as.numeric(as.character(rel.mfx.frame.lowinfo$High))

colnames(rel.mfx.frame.highinfo) <- c("Low", "Mid", "High", 
                                      "Trait", "Ideology", "Response")
rel.mfx.frame.highinfo$Response <- factor(rel.mfx.frame.highinfo$Response, 
                                          labels = c("Approve More of Senator 1  ", 
                                                     "Approve Equally  ", 
                                                     "Approve More of Senator 2  "))
rel.mfx.frame.highinfo$Trait <- factor(rel.mfx.frame.highinfo$Trait, 
                                       labels = c("Openness", 
                                                  "Conscientiousness", 
                                                  "Extraversion", 
                                                  "Agreeableness", 
                                                  "Emotional Stability"))
rel.mfx.frame.highinfo$Ideology <- factor(rel.mfx.frame.highinfo$Ideology,
                                          labels = c("Liberal", 
                                                     "Moderate", 
                                                     "Conservative"))
rel.mfx.frame.highinfo$Ideology <- factor(rel.mfx.frame.highinfo$Ideology,
                                          levels = rev(levels(rel.mfx.frame.highinfo$Ideology)))
rel.mfx.frame.highinfo$Response <- factor(rel.mfx.frame.highinfo$Response,
                                          levels = rev(levels(rel.mfx.frame.highinfo$Response)))
rel.mfx.frame.highinfo$Low <- as.numeric(as.character(rel.mfx.frame.highinfo$Low))
rel.mfx.frame.highinfo$Mid <- as.numeric(as.character(rel.mfx.frame.highinfo$Mid))
rel.mfx.frame.highinfo$High <- as.numeric(as.character(rel.mfx.frame.highinfo$High))


rel.plot.mfx <- ggplot(data.frame(rel.mfx.frame), 
                       aes(x = Response, y = Mid, 
                           shape = Ideology, color = Ideology)) + 
  geom_point(position=position_dodge(width=0.5)) + 
  geom_errorbar(aes(ymin = Low, ymax = High), 
                position=position_dodge(width=0.5), 
                width = 0.3) + 
  theme_bw() + 
  facet_wrap(~ Trait, ncol = 5) + 
  ylab('\nPredicted Change in Probablity of Providing Given Response') + 
  xlab("Senator Approval\n") + 
  theme(panel.margin = unit(0.6, "lines"), 
        axis.text.x = element_text(angle = 45, hjust = 1)) + 
  coord_flip() +   
  scale_color_grey(guide = guide_legend(reverse = TRUE),
                   name = "Respondent Ideology", 
                   start = 0, end = 0.8) + 
  scale_shape_discrete(guide = guide_legend(reverse = TRUE),
                       name = "Respondent Ideology") + 
  geom_hline(yintercept = 0, linetype = "dotted") +
  ylim(-0.2, 0.2)


rel.plot.mfx.lowinfo <- ggplot(data.frame(rel.mfx.frame.lowinfo), 
                               aes(x = Response, y = Mid, 
                                   shape = Ideology, 
                                   color = Ideology)) + 
  geom_point(position=position_dodge(width=0.5)) + 
  geom_errorbar(aes(ymin = Low, ymax = High), 
                position=position_dodge(width=0.5), 
                width = 0.3) + 
  theme_bw() + 
  facet_wrap(~ Trait, ncol = 5) + 
  ylab('\nPredicted Change in Probablity of Providing Given Response') + 
  xlab("Senator Approval\n") + 
  theme(panel.margin = unit(0.6, "lines"), 
        axis.text.x = element_text(angle = 45, hjust = 1)) + 
  coord_flip() +   
  scale_color_grey(guide = guide_legend(reverse = TRUE),
                   name = "Respondent Ideology", 
                   start = 0, end = 0.8) + 
  scale_shape_discrete(guide = guide_legend(reverse = TRUE),
                       name = "Respondent Ideology") + 
  geom_hline(yintercept = 0, linetype = "dotted") +
  ylim(-0.65, 0.65)


rel.plot.mfx.highinfo <- ggplot(data.frame(rel.mfx.frame.highinfo), 
                                aes(x = Response, y = Mid, 
                                    shape = Ideology, color = Ideology)) + 
  geom_point(position=position_dodge(width=0.5)) + 
  geom_errorbar(aes(ymin = Low, ymax = High), 
                position=position_dodge(width=0.5), 
                width = 0.3) + 
  theme_bw() + 
  facet_wrap(~ Trait, ncol = 5) + 
  ylab('\nPredicted Change in Probablity of Providing Given Response') + 
  xlab("Senator Approval\n") + 
  theme(panel.margin = unit(0.6, "lines"), 
        axis.text.x = element_text(angle = 45, hjust = 1)) + 
  coord_flip() +   
  scale_color_grey(guide = guide_legend(reverse = TRUE),
                   name = "Respondent Ideology", 
                   start = 0, end = 0.8) + 
  scale_shape_discrete(guide = guide_legend(reverse = TRUE),
                       name = "Respondent Ideology") + 
  geom_hline(yintercept = 0, linetype = "dotted") +
  ylim(-0.2, 0.2)

ggsave(rel.plot.mfx,
       file = "Figure 5.pdf", 
       height = 4, width = 10)

ggsave(rel.plot.mfx.lowinfo, 
       file = "Figure G-2.pdf", 
       height = 4, width = 10)

ggsave(rel.plot.mfx.highinfo,
       file = "Figure H-2.pdf", 
       height = 4, width = 10)





### Correlation Plots (Figures 3, C-1, D-1)
# getting the mean trait values for each office
cces.uber$meantraits <- apply(subset(cces.uber, select = c(cong_openn, 
                                                           cong_consc, 
                                                           cong_extra, 
                                                           cong_agree, 
                                                           cong_emoti)),
                              1, mean, na.rm = TRUE)
cces.rep$meantraits <- apply(subset(cces.rep, select = c(cong_openn, 
                                                         cong_consc, 
                                                         cong_extra, 
                                                         cong_agree, 
                                                         cong_emoti)),
                             1, mean, na.rm = TRUE)
cces.sen$meantraits <- apply(subset(cces.sen, select = c(cong_openn, 
                                                         cong_consc, 
                                                         cong_extra, 
                                                         cong_agree, 
                                                         cong_emoti)),
                             1, mean, na.rm = TRUE)
cces14.sen2$meantraits <- apply(subset(cces14.sen2, select = c(cong_openn, 
                                                               cong_consc, 
                                                               cong_extra, 
                                                               cong_agree, 
                                                               cong_emoti)),
                                1, mean, na.rm = TRUE)
newcces_16_merged$meantraits <- apply(subset(newcces_16_merged, select = c(obama_openn, 
                                                                           obama_consc, 
                                                                           obama_extra, 
                                                                           obama_agree, 
                                                                           obama_emoti)),
                                      1, mean, na.rm = TRUE)

# getting the mean divergences
cces.uber$meandivergence <- apply(with(cces.uber, data.frame(abs(cong_openn - self_openn), 
                                                             abs(cong_consc - self_consc),
                                                             abs(cong_extra - self_extra),
                                                             abs(cong_agree - self_agree),
                                                             abs(cong_emoti - self_emoti))),
                                  1, mean)

cces.rep$meandivergence <- apply(with(cces.rep, data.frame(abs(cong_openn - self_openn), 
                                                           abs(cong_consc - self_consc),
                                                           abs(cong_extra - self_extra),
                                                           abs(cong_agree - self_agree),
                                                           abs(cong_emoti - self_emoti))),
                                  1, mean)
cces.sen$meandivergence <- apply(with(cces.sen, data.frame(abs(cong_openn - self_openn), 
                                                           abs(cong_consc - self_consc),
                                                           abs(cong_extra - self_extra),
                                                           abs(cong_agree - self_agree),
                                                           abs(cong_emoti - self_emoti))),
                                 1, mean)
cces14.sen2$meandivergence <- apply(with(cces14.sen2, 
                                         data.frame(abs(cong_openn - self_openn), 
                                                    abs(cong_consc - self_consc),
                                                    abs(cong_extra - self_extra),
                                                    abs(cong_agree - self_agree),
                                                    abs(cong_emoti - self_emoti))),
                                 1, mean)
newcces_16_merged$meandivergence <- apply(with(newcces_16_merged, 
                                               data.frame(abs(obama_openn - self_openn), 
                                                          abs(obama_consc - self_consc),
                                                          abs(obama_extra - self_extra),
                                                          abs(obama_agree - self_agree),
                                                          abs(obama_emoti - self_emoti))),
                                    1, mean)


# bootstrapping the correlations to get confidence intervals
set.seed(1)
f <- function(data, i){
          abs(cor(data[i, 1], 
                  data[i, 2], 
                  method = "spearman", 
                  use = "complete.obs"))
     }

meanval <- with(cces.uber, 
                boot::boot(cbind(as.numeric(cong_app), 
                                 meantraits), 
                           statistic = f, R = 1000)$t)
opennval <- with(cces.uber, 
                 boot::boot(cbind(as.numeric(cong_app), 
                                  cong_openn), 
                            statistic = f, R = 1000)$t)
conscval <- with(cces.uber, 
                 boot::boot(cbind(as.numeric(cong_app), 
                                  cong_consc), 
                            statistic = f, R = 1000)$t)
extraval <- with(cces.uber, 
                 boot::boot(cbind(as.numeric(cong_app), 
                                  cong_extra), 
                            statistic = f, R = 1000)$t)
agreeval <- with(cces.uber, 
                 boot::boot(cbind(as.numeric(cong_app), 
                                  cong_agree), 
                            statistic = f, R = 1000)$t)
emotival <- with(cces.uber, 
                 boot::boot(cbind(as.numeric(cong_app), 
                                  cong_emoti), 
                            statistic = f, R = 1000)$t)
meancon <- with(cces.uber, 
                boot::boot(cbind(as.numeric(cong_app), 
                                 meandivergence), 
                           statistic = f, R = 1000)$t)
openncon <- with(cces.uber, 
                 boot::boot(cbind(as.numeric(cong_app), 
                                  abs(self_openn - cong_openn)), 
                            statistic = f, R = 1000)$t)
consccon <- with(cces.uber, 
                 boot::boot(cbind(as.numeric(cong_app), 
                                  abs(self_consc - cong_consc)), 
                            statistic = f, R = 1000)$t)
extracon <- with(cces.uber, 
                 boot::boot(cbind(as.numeric(cong_app), 
                                  abs(self_extra - cong_extra)), 
                            statistic = f, R = 1000)$t)
agreecon <- with(cces.uber, 
                 boot::boot(cbind(as.numeric(cong_app), 
                                  abs(self_agree - cong_agree)), 
                            statistic = f, R = 1000)$t)
emoticon <- with(cces.uber, 
                 boot::boot(cbind(as.numeric(cong_app), 
                                  abs(self_emoti - cong_emoti)), 
                            statistic = f, R = 1000)$t)

meanval.rep <- with(cces.rep, 
                    boot::boot(cbind(as.numeric(cong_app), 
                                     meantraits), 
                               statistic = f, R = 1000)$t)
opennval.rep <- with(cces.rep, 
                     boot::boot(cbind(as.numeric(cong_app), 
                                      cong_openn), 
                                statistic = f, R = 1000)$t)
conscval.rep <- with(cces.rep, 
                     boot::boot(cbind(as.numeric(cong_app), 
                                      cong_consc), 
                                statistic = f, R = 1000)$t)
extraval.rep <- with(cces.rep, 
                     boot::boot(cbind(as.numeric(cong_app), 
                                      cong_extra), 
                                statistic = f, R = 1000)$t)
agreeval.rep <- with(cces.rep, 
                     boot::boot(cbind(as.numeric(cong_app), 
                                      cong_agree), 
                                statistic = f, R = 1000)$t)
emotival.rep <- with(cces.rep, 
                     boot::boot(cbind(as.numeric(cong_app), 
                                      cong_emoti), 
                                statistic = f, R = 1000)$t)
meancon.rep <- with(cces.rep, 
                    boot::boot(cbind(as.numeric(cong_app), 
                                     meandivergence), 
                               statistic = f, R = 1000)$t)
openncon.rep <- with(cces.rep, 
                     boot::boot(cbind(as.numeric(cong_app), 
                                      abs(self_openn - cong_openn)), 
                                statistic = f, R = 1000)$t)
consccon.rep <- with(cces.rep, 
                     boot::boot(cbind(as.numeric(cong_app), 
                                      abs(self_consc - cong_consc)), 
                                statistic = f, R = 1000)$t)
extracon.rep <- with(cces.rep, 
                     boot::boot(cbind(as.numeric(cong_app), 
                                      abs(self_extra - cong_extra)), 
                                statistic = f, R = 1000)$t)
agreecon.rep <- with(cces.rep, 
                     boot::boot(cbind(as.numeric(cong_app), 
                                      abs(self_agree - cong_agree)), 
                                statistic = f, R = 1000)$t)
emoticon.rep <- with(cces.rep, 
                     boot::boot(cbind(as.numeric(cong_app), 
                                      abs(self_emoti - cong_emoti)), 
                                statistic = f, R = 1000)$t)

meanval.sen <- with(cces.sen, 
                    boot::boot(cbind(as.numeric(cong_app), 
                                     meantraits), 
                               statistic = f, R = 1000)$t)
opennval.sen <- with(cces.sen, 
                     boot::boot(cbind(as.numeric(cong_app), 
                                      cong_openn), 
                                statistic = f, R = 1000)$t)
conscval.sen <- with(cces.sen, 
                     boot::boot(cbind(as.numeric(cong_app), 
                                      cong_consc), 
                                statistic = f, R = 1000)$t)
extraval.sen <- with(cces.sen, 
                     boot::boot(cbind(as.numeric(cong_app), 
                                      cong_extra), 
                                statistic = f, R = 1000)$t)
agreeval.sen <- with(cces.sen, 
                     boot::boot(cbind(as.numeric(cong_app), 
                                      cong_agree), 
                                statistic = f, R = 1000)$t)
emotival.sen <- with(cces.sen, 
                     boot::boot(cbind(as.numeric(cong_app), 
                                      cong_emoti), 
                                statistic = f, R = 1000)$t)
meancon.sen <- with(cces.sen, 
                    boot::boot(cbind(as.numeric(cong_app), 
                                     meandivergence), 
                               statistic = f, R = 1000)$t)
openncon.sen <- with(cces.sen, 
                     boot::boot(cbind(as.numeric(cong_app), 
                                      abs(self_openn - cong_openn)), 
                                statistic = f, R = 1000)$t)
consccon.sen <- with(cces.sen, 
                     boot::boot(cbind(as.numeric(cong_app), 
                                      abs(self_consc - cong_consc)), 
                                statistic = f, R = 1000)$t)
extracon.sen <- with(cces.sen, 
                     boot::boot(cbind(as.numeric(cong_app), 
                                      abs(self_extra - cong_extra)), 
                                statistic = f, R = 1000)$t)
agreecon.sen <- with(cces.sen, 
                     boot::boot(cbind(as.numeric(cong_app), 
                                      abs(self_agree - cong_agree)), 
                                statistic = f, R = 1000)$t)
emoticon.sen <- with(cces.sen, 
                     boot::boot(cbind(as.numeric(cong_app), 
                                      abs(self_emoti - cong_emoti)), 
                                statistic = f, R = 1000)$t)

meanval.sen14 <- with(cces14.sen2, 
                      boot::boot(cbind(as.numeric(cong_app), 
                                       meantraits), 
                                 statistic = f, R = 1000)$t)
opennval.sen14 <- with(cces14.sen2, 
                       boot::boot(cbind(as.numeric(cong_app), 
                                        cong_openn), 
                                  statistic = f, R = 1000)$t)
conscval.sen14 <- with(cces14.sen2, 
                       boot::boot(cbind(as.numeric(cong_app), 
                                        cong_consc), 
                                  statistic = f, R = 1000)$t)
extraval.sen14 <- with(cces14.sen2, 
                       boot::boot(cbind(as.numeric(cong_app), 
                                        cong_extra), 
                                  statistic = f, R = 1000)$t)
agreeval.sen14 <- with(cces14.sen2, 
                       boot::boot(cbind(as.numeric(cong_app), 
                                        cong_agree), 
                                  statistic = f, R = 1000)$t)
emotival.sen14 <- with(cces14.sen2, 
                       boot::boot(cbind(as.numeric(cong_app), 
                                        cong_emoti), 
                                  statistic = f, R = 1000)$t)
meancon.sen14 <- with(cces14.sen2, 
                      boot::boot(cbind(as.numeric(cong_app), 
                                       meandivergence), 
                                 statistic = f, R = 1000)$t)
openncon.sen14 <- with(cces14.sen2, 
                       boot::boot(cbind(as.numeric(cong_app), 
                                        abs(self_openn - cong_openn)), 
                                  statistic = f, R = 1000)$t)
consccon.sen14 <- with(cces14.sen2, 
                       boot::boot(cbind(as.numeric(cong_app), 
                                        abs(self_consc - cong_consc)), 
                                  statistic = f, R = 1000)$t)
extracon.sen14 <- with(cces14.sen2, 
                       boot::boot(cbind(as.numeric(cong_app), 
                                        abs(self_extra - cong_extra)), 
                                  statistic = f, R = 1000)$t)
agreecon.sen14 <- with(cces14.sen2, 
                       boot::boot(cbind(as.numeric(cong_app), 
                                        abs(self_agree - cong_agree)), 
                                  statistic = f, R = 1000)$t)
emoticon.sen14 <- with(cces14.sen2, 
                       boot::boot(cbind(as.numeric(cong_app), 
                                        abs(self_emoti - cong_emoti)), 
                                  statistic = f, R = 1000)$t)

meanval.obama <- with(newcces_16_merged, 
                      boot::boot(cbind(as.numeric(obama_app2), 
                                       meantraits), 
                                 statistic = f, R = 1000)$t)
opennval.obama <- with(newcces_16_merged, 
                       boot::boot(cbind(as.numeric(obama_app2), 
                                        obama_openn), 
                                  statistic = f, R = 1000)$t)
conscval.obama <- with(newcces_16_merged, 
                       boot::boot(cbind(as.numeric(obama_app2), 
                                        obama_consc), 
                                  statistic = f, R = 1000)$t)
extraval.obama <- with(newcces_16_merged, 
                       boot::boot(cbind(as.numeric(obama_app2), 
                                        obama_extra), 
                                  statistic = f, R = 1000)$t)
agreeval.obama <- with(newcces_16_merged, 
                       boot::boot(cbind(as.numeric(obama_app2), 
                                        obama_agree), 
                                  statistic = f, R = 1000)$t)
emotival.obama <- with(newcces_16_merged, 
                       boot::boot(cbind(as.numeric(obama_app2), 
                                        obama_emoti), 
                                  statistic = f, R = 1000)$t)
meancon.obama <- with(newcces_16_merged, 
                      boot::boot(cbind(as.numeric(obama_app2), 
                                       meandivergence), 
                                 statistic = f, R = 1000)$t)
openncon.obama <- with(newcces_16_merged, 
                       boot::boot(cbind(as.numeric(obama_app2), 
                                        abs(self_openn - obama_openn)), 
                                  statistic = f, R = 1000)$t)
consccon.obama <- with(newcces_16_merged, 
                       boot::boot(cbind(as.numeric(obama_app2), 
                                        abs(self_consc - obama_consc)), 
                                  statistic = f, R = 1000)$t)
extracon.obama <- with(newcces_16_merged, 
                       boot::boot(cbind(as.numeric(obama_app2), 
                                        abs(self_extra - obama_extra)), 
                                  statistic = f, R = 1000)$t)
agreecon.obama <- with(newcces_16_merged, 
                       boot::boot(cbind(as.numeric(obama_app2), 
                                        abs(self_agree - obama_agree)), 
                                  statistic = f, R = 1000)$t)
emoticon.obama <- with(newcces_16_merged, 
                       boot::boot(cbind(as.numeric(obama_app2), 
                                        abs(self_emoti - obama_emoti)), 
                                  statistic = f, R = 1000)$t)


# putting all the correlations into a data frame
allcors <- cbind(meanval,
                 opennval,
                 conscval,
                 extraval,
                 agreeval,
                 emotival,
                 meancon,
                 openncon,
                 consccon,
                 extracon,
                 agreecon,
                 emoticon)

allcors.rep <- cbind(meanval.rep,
                 opennval.rep,
                 conscval.rep,
                 extraval.rep,
                 agreeval.rep,
                 emotival.rep,
                 meancon.rep,
                 openncon.rep,
                 consccon.rep,
                 extracon.rep,
                 agreecon.rep,
                 emoticon.rep)

allcors.sen <- cbind(meanval.sen,
                     opennval.sen,
                     conscval.sen,
                     extraval.sen,
                     agreeval.sen,
                     emotival.sen,
                     meancon.sen,
                     openncon.sen,
                     consccon.sen,
                     extracon.sen,
                     agreecon.sen,
                     emoticon.sen)

allcors.sen14 <- cbind(meanval.sen14,
                     opennval.sen14,
                     conscval.sen14,
                     extraval.sen14,
                     agreeval.sen14,
                     emotival.sen14,
                     meancon.sen14,
                     openncon.sen14,
                     consccon.sen14,
                     extracon.sen14,
                     agreecon.sen14,
                     emoticon.sen14)

allcors.obama <- cbind(meanval.obama,
                       opennval.obama,
                       conscval.obama,
                       extraval.obama,
                       agreeval.obama,
                       emotival.obama,
                       meancon.obama,
                       openncon.obama,
                       consccon.obama,
                       extracon.obama,
                       agreecon.obama,
                       emoticon.obama)

corr.frame <- data.frame(t(rbind(apply(allcors, 2, 
                                       quantile, 
                                       c(0.05, 0.5, 0.95)))))

colnames(corr.frame) <- c("lower", "pred", "upper")
corr.frame$Traits <- rep(c("Pooled", 
                           "Openness", 
                           "Conscientiousness", 
                           "Extraversion", 
                           "Agreeableness", 
                           "Emotional Stability"), 2)

corr.frame$Traits <- factor(corr.frame$Traits, 
                            levels = rev(c("Pooled", 
                                           "Openness", 
                                           "Conscientiousness", 
                                           "Extraversion", 
                                           "Agreeableness", 
                                           "Emotional Stability")))

corr.frame$Measure <- c(rep("Valence", 6), 
                        rep("Congruence", 6))  
corr.frame$Office <- "All Legislators"


# making the plots
corr.frame.rep <- data.frame(t(rbind(apply(allcors.rep, 2, 
                                           quantile, 
                                           c(0.05, 0.5, 0.95)))))
colnames(corr.frame.rep) <- c("lower", "pred", "upper")
corr.frame.rep$Traits <- rep(c("Pooled", 
                               "Openness", 
                               "Conscientiousness", 
                               "Extraversion", 
                               "Agreeableness", 
                               "Emotional Stability"), 2)

corr.frame.rep$Traits <- factor(corr.frame.rep$Traits, 
                                levels = rev(c("Pooled", 
                                               "Openness", 
                                               "Conscientiousness", 
                                               "Extraversion", 
                                               "Agreeableness", 
                                               "Emotional Stability")))

corr.frame.rep$Measure <- c(rep("Valence", 6), 
                            rep("Congruence", 6)) 
corr.frame.rep$Office <- "Representatives"

corr.frame.sen <- data.frame(t(rbind(apply(allcors.sen, 2, 
                                           quantile, 
                                           c(0.05, 0.5, 0.95)))))

colnames(corr.frame.sen) <- c("lower", "pred", "upper")
corr.frame.sen$Traits <- rep(c("Pooled", "Openness", 
                               "Conscientiousness", "Extraversion", 
                               "Agreeableness", "Emotional Stability"), 2)

corr.frame.sen$Traits <- factor(corr.frame.sen$Traits, 
                                levels = rev(c("Pooled", 
                                               "Openness", 
                                               "Conscientiousness", 
                                               "Extraversion", 
                                               "Agreeableness", 
                                               "Emotional Stability")))

corr.frame.sen$Measure <- c(rep("Valence", 6), rep("Congruence", 6)) 
corr.frame.sen$Office <- "Senators"

corr.frame.sen14 <- data.frame(t(rbind(apply(allcors.sen14, 
                                             2, quantile, 
                                             c(0.05, 0.5, 0.95)))))

colnames(corr.frame.sen14) <- c("lower", "pred", "upper")
corr.frame.sen14$Traits <- rep(c("Pooled", 
                                 "Openness", 
                                 "Conscientiousness", 
                                 "Extraversion", 
                                 "Agreeableness", 
                                 "Emotional Stability"), 2)

corr.frame.sen14$Traits <- factor(corr.frame.sen14$Traits, 
                                  levels = rev(c("Pooled", 
                                                 "Openness", 
                                                 "Conscientiousness", 
                                                 "Extraversion", 
                                                 "Agreeableness", 
                                                 "Emotional Stability")))

corr.frame.sen14$Measure <- c(rep("Valence", 6), 
                              rep("Congruence", 6)) 

corr.frame.obama <- data.frame(t(rbind(apply(allcors.obama, 2, 
                                             quantile, 
                                             c(0.05, 0.5, 0.95)))))

colnames(corr.frame.obama) <- c("lower", "pred", "upper")
corr.frame.obama$Traits <- rep(c("Pooled", 
                                 "Openness", 
                                 "Conscientiousness", 
                                 "Extraversion", 
                                 "Agreeableness", 
                                 "Emotional Stability"),2)

corr.frame.obama$Traits <- factor(corr.frame.obama$Traits, 
                                  levels = rev(c("Pooled", 
                                                 "Openness", 
                                                 "Conscientiousness", 
                                                 "Extraversion", 
                                                 "Agreeableness", 
                                                 "Emotional Stability")))

corr.frame.obama$Measure <- c(rep("Valence", 6), rep("Congruence", 6)) 

corr.frame.pooled <- rbind(corr.frame, corr.frame.rep, corr.frame.sen)
corr.frame.pooled$Office <- factor(corr.frame.pooled$Office, 
                                   levels = c("All Legislators", 
                                              "Representatives", 
                                              "Senators"))

corrplot <- ggplot(corr.frame.pooled, 
                   aes(x = Traits, y = pred, 
                       color = Measure, shape = Measure)) + 
  geom_errorbar(aes(ymin = lower, ymax = upper), width  = .3,
                position=position_dodge(width=0.5)) + 
  geom_point(position=position_dodge(width=0.5)) + 
  coord_flip() + 
  theme_bw() + 
  theme(panel.margin = unit(0.6, "lines"), 
        axis.text.x = element_text(angle = 45, hjust = 1)) + 
  facet_wrap(~Office, nrow = 1) +
  ylab('\nAbsolute Value of Correlation Between Personality Traits and Legislator Approval') + 
  xlab('Personality Trait\n') + 
  ylim(0,1) + 
  scale_color_grey(guide = guide_legend(reverse = TRUE), 
                   name = "Measure", start = 0, end = 0.6) + 
  scale_shape_discrete(guide = guide_legend(reverse = TRUE),
                       name = "Measure") 

corrplot.sen14 <- ggplot(corr.frame.sen14, 
                         aes(x = Traits, y = pred, 
                             color = Measure, shape = Measure)) + 
  geom_errorbar(aes(ymin = lower, ymax = upper), width  = .3,
                position=position_dodge(width=0.5)) + 
  geom_point(position=position_dodge(width=0.5)) + 
  coord_flip() + 
  theme_bw() + 
  ylab('\nAbsolute Value of Correlation Between\nPersonality Traits and Senator Approval') + 
  xlab('Personality Trait\n') + 
  ylim(0,1) + 
  scale_color_grey(guide = guide_legend(reverse = TRUE), 
                   name = "Measure", start = 0, end = 0.6) + 
  scale_shape_discrete(guide = guide_legend(reverse = TRUE),
                       name = "Measure") 

corrplot.obama <- ggplot(corr.frame.obama, 
                         aes(x = Traits, y = pred, 
                             color = Measure, shape = Measure)) + 
  geom_errorbar(aes(ymin = lower, ymax = upper), width  = .3,
                position=position_dodge(width=0.5)) + 
  geom_point(position=position_dodge(width=0.5)) + 
  coord_flip() + 
  theme_bw() + 
  ylab('\nAbsolute Value of Correlation Between\nPersonality Traits and Obama Approval') + 
  xlab('Personality Trait\n') + 
  ylim(0,1) + 
  scale_color_grey(guide = guide_legend(reverse = TRUE), 
                   name = "Measure", start = 0, end = 0.6) + 
  scale_shape_discrete(guide = guide_legend(reverse = TRUE),
                       name = "Measure") 

corrplot.pres <- ggplot(corr.frame.pooled,
                        aes(x = Traits, y = pred, 
                            color = Measure, shape = Measure)) + 
  geom_errorbar(aes(ymin = lower, ymax = upper), width  = .3,
                position=position_dodge(width=0.5)) + 
  geom_point(position=position_dodge(width=0.5)) + 
  coord_flip() + 
  theme_bw() + 
  theme(panel.margin = unit(0.8, "lines"), 
        axis.text.x = element_text(angle = 45, hjust = 1)) + 
  facet_wrap(~Office) +
  ylab('\nAbsolute Value of Correlation Between\nPersonality Traits and Legislator Approval') + 
  xlab('Personality Trait\n') + 
  ylim(0,1) + 
  scale_color_discrete(guide = guide_legend(reverse = TRUE), 
                       name = "Measure") + 
  scale_shape_discrete(guide = guide_legend(reverse = TRUE),
                       name = "Measure") 

# Figure 3
ggsave(corrplot, 
       file = "Figure 3.pdf", 
       height = 4, width = 9)

# Figure D-1
ggsave(corrplot.sen14, 
       file = "Figure D-1.pdf", 
       height = 4, width = 6)

# Figure C-1
ggsave(corrplot.obama, 
       file = "Figure C-1.pdf", 
       height = 4, width = 6)



#### Year-to-year correlations
# trim function
trim <- function (x)gsub("^\\s+|\\s+$", "", x)

# state abbreviations
abvs <- read.csv("stateabvs.csv")

### cleaning up some names across years
cces.uber2 <- cces.uber
cces.uber2$CurrentHouseName <- factor(gsub("[[:space:]]*$","", 
                                           as.character(cces.uber2$CurrentHouseName), 
                                           perl=T))

cces.uber2$CurrentSen1Name <- factor(cces.uber2$CurrentSen1Name)
cces.uber2$CurrentSen2Name <- factor(cces.uber2$CurrentSen2Name)
colnames(cces.uber2)[colnames(cces.uber2) == "state"] <- "state_name"
cces.uber2 <- merge(cces.uber2, abvs)
colnames(cces.uber2)[colnames(cces.uber2) == "state_abv"] <- "state"

# combining them for analysis here
newrep14 <- subset(cces.uber2, year == 2014 & office == "Representative",
                   select = c(CurrentHouseName,
                              cong_openn,
                              cong_consc,
                              cong_extra,
                              cong_agree,
                              cong_emoti,
                              year,
                              rep_ideo,
                              state))

newrep16 <- subset(cces.uber2, year == 2016 & office == "Representative",
                   select = c(CurrentHouseName,
                              cong_openn,
                              cong_consc,
                              cong_extra,
                              cong_agree,
                              cong_emoti,
                              year,
                              rep_ideo,
                              state))

newsen114 <- subset(cces.uber2, year == 2014 & office == "Senator 1",
                    select = c(CurrentSen1Name,
                               cong_openn,
                               cong_consc,
                               cong_extra,
                               cong_agree,
                               cong_emoti,
                               year,
                               sen1_ideo,
                               state))

newsen116 <- subset(cces.uber2, year == 2016 & office == "Senator 1",
                    select = c(CurrentSen1Name,
                               cong_openn,
                               cong_consc,
                               cong_extra,
                               cong_agree,
                               cong_emoti,
                               year,
                               sen1_ideo,
                               state))

newsen214 <- subset(cces.uber2, year == 2014 & office == "Senator 2",
                    select = c(CurrentSen2Name,
                               cong_openn,
                               cong_consc,
                               cong_extra,
                               cong_agree,
                               cong_emoti,
                               year,
                               sen2_ideo,
                               state))

newsen216 <- subset(cces.uber2, year == 2016 & office == "Senator 2",
                    select = c(CurrentSen2Name,
                               cong_openn,
                               cong_consc,
                               cong_extra,
                               cong_agree,
                               cong_emoti,
                               year,
                               sen2_ideo,
                               state))

colnames(newrep14)[c(1,8)] <- c("cong_name", "cong_ideo")
colnames(newrep16)[c(1,8)] <- c("cong_name", "cong_ideo")
colnames(newsen114)[c(1,8)] <- c("cong_name", "cong_ideo")
colnames(newsen116)[c(1,8)] <- c("cong_name", "cong_ideo")
colnames(newsen214)[c(1,8)] <- c("cong_name", "cong_ideo")
colnames(newsen216)[c(1,8)] <- c("cong_name", "cong_ideo")

newcces <- rbind(newrep14,
                 newrep16,
                 newsen114,
                 newsen116,
                 newsen214,
                 newsen216)

newcces$cong_name <- iconv(newcces$cong_name, to='ASCII//TRANSLIT')
newcces <- subset(newcces, cong_name != "")
newcces$lastname <- unlist(lapply(strsplit(gsub(", Jr.|III|IV", "", newcces$cong_name), " "), 
                                             function(x) { return(x[length(x)]) }))
newcces$lastname <- trim(newcces$lastname)


# bootstrapping the correlations
newcorr.frame <- NULL
newideo.frame <- NULL
ideodiff.frame <- NULL
persdiff.frame <- NULL

numBoot <- 1000
set.seed(1384)

pb <- txtProgressBar(min = 0, max = numBoot, style = 3)

for(k in 1:numBoot){
newcces.sample <- newcces[sample(1:dim(newcces)[1], replace = TRUE),]
  
newcces.means14 <- ddply(subset(newcces.sample, year == 2014), 
                         .variables = .(cong_name, state), summarise, 
                         openn14 = mean(cong_openn, na.rm = TRUE),
                         consc14 = mean(cong_consc, na.rm = TRUE),
                         extra14 = mean(cong_extra, na.rm = TRUE),
                         agree14 = mean(cong_agree, na.rm = TRUE),
                         emoti14 = mean(cong_emoti, na.rm = TRUE),
                         cong_ideo14 = mean(cong_ideo, na.rm = TRUE),
                         lastname = unique(lastname),
                         n14 = length(cong_name))

newcces.means16 <- ddply(subset(newcces.sample, year == 2016), 
                         .variables = .(cong_name, state), summarise, 
                         openn16 = mean(cong_openn, na.rm = TRUE),
                         consc16 = mean(cong_consc, na.rm = TRUE),
                         extra16 = mean(cong_extra, na.rm = TRUE),
                         agree16 = mean(cong_agree, na.rm = TRUE),
                         emoti16 = mean(cong_emoti, na.rm = TRUE),
                         cong_ideo16 = mean(cong_ideo, na.rm = TRUE),
                         lastname = unique(lastname),
                         n16 = length(cong_name))

newcces.sample <- merge(newcces.means14, newcces.means16, by = "lastname")
newcces.sample <- subset(newcces.sample, state.x == state.y)

# matching the names across years to get total sample sizes
nameframe <- NULL
for(i in 1:length(unique(newcces.sample$lastname))){
  foo <- newcces.sample[newcces.sample$lastname == unique(newcces.sample$lastname)[i],]
  foo$dist <- stringdist(foo$cong_name.x,foo$cong_name.y, method = "jw")
  foo$dist[foo$dist > .25] <- NA
  for(j in 1:length(unique(foo$cong_name.x))){
    foo2 <- foo[which(foo$cong_name.x == unique(foo$cong_name.x)[j]),][which.min(foo[which(foo$cong_name.x == unique(foo$cong_name.x)[j]),]$dist),]
    nameframe <- rbind(nameframe, foo2)
  }
}

newcces.sample <- nameframe
newcces.sample <- subset(newcces.sample, select = -c(cong_name.y))
colnames(newcces.sample)[2] <- "cong_name"
newcces.sample <- newcces.sample[order(as.character(newcces.sample$cong_name)),]
newcces.sample$n <- newcces.sample$n14 + newcces.sample$n16

# getting the year-specific traits
agg.new.means <- data.frame(name = rep(newcces.sample$cong_name, 5),
                            trait14 = c(newcces.sample$openn14,
                                        newcces.sample$consc14,
                                        newcces.sample$extra14,
                                        newcces.sample$agree14,
                                        newcces.sample$emoti14),
                            trait16 = c(newcces.sample$openn16,
                                        newcces.sample$consc16,
                                        newcces.sample$extra16,
                                        newcces.sample$agree16,
                                        newcces.sample$emoti16),
                            n = rep(newcces.sample$n, 5))

# getting the year-to-year correlations
newcorr <- NULL
newideo <- NULL
persdiff <- NULL
ideodiff <- NULL
newcorrCI <- NULL
newideoCI <- NULL

for(i in 1:max(newcces.sample$n, na.rm = TRUE)){
  newcorr <- rbind(newcorr, 
                   c(i, with(na.omit(subset(agg.new.means, n >= i)), 
                             weightedCorr(trait14, trait16, 
                                      method = "spearman", weights = n))))
  newideo <- rbind(newideo,
                   c(i, with(na.omit(subset(newcces.sample, n >= i)), 
                             weightedCorr(cong_ideo14, cong_ideo16, 
                                 method = "spearman", weights = n))))
  ideodiff <- rbind(ideodiff,
                    c(i, with(subset(newcces.sample, n >= i), 
                              weighted.mean(abs(cong_ideo14 - cong_ideo16), 
                                            na.rm = TRUE, w = n))))
  persdiff <- rbind(persdiff,
                    c(i, with(subset(agg.new.means, n >= i), 
                              weighted.mean(abs(trait14 - trait16), 
                                            na.rm = TRUE, w = n))))
  }
newcorr.frame <- smartbind(newcorr.frame, as.data.frame(t(newcorr))[-1,])
newideo.frame <- smartbind(newideo.frame, as.data.frame(t(newideo))[-1,])
ideodiff.frame <- smartbind(ideodiff.frame, as.data.frame(t(ideodiff))[-1,])
persdiff.frame <- smartbind(persdiff.frame, as.data.frame(t(persdiff))[-1,])

setTxtProgressBar(pb, k)
}

# removing duplicates
newcorr.frame <- unique(newcorr.frame)
newideo.frame <- unique(newideo.frame)
ideodiff.frame <- unique(ideodiff.frame)
persdiff.frame <- unique(persdiff.frame)

# putting everything in a data frame for plotting
corr.frame <- rbind(data.frame(Respondents = 1:dim(newcorr.frame)[2],
                               Correlation = apply(newcorr.frame,2,mean,na.rm = TRUE),
                               CI.low = apply(newcorr.frame,2,
                                              function(x){max(-1,mean(x, na.rm = TRUE) -
                                                  1.645*sd(x, na.rm = TRUE), 
                                                  na.rm = TRUE)}),
                               CI.high= apply(newcorr.frame,2,
                                              function(x){min(1,mean(x, na.rm = TRUE) +
                                                  1.645*sd(x, na.rm = TRUE), 
                                                  na.rm = TRUE)}),
                               Traits = "Personality Traits"), 
                    data.frame(Respondents = 1:dim(newideo.frame)[2],
                               Correlation = apply(newideo.frame,2,mean,na.rm = TRUE),
                               CI.low = apply(newideo.frame,2,
                                              function(x){max(-1,mean(x, na.rm = TRUE) -
                                                                1.645*sd(x, na.rm = TRUE), 
                                                              na.rm = TRUE)}),
                               CI.high= apply(newideo.frame,2,
                                              function(x){min(1,mean(x, na.rm = TRUE) +
                                                                1.645*sd(x, na.rm = TRUE),
                                                              na.rm = TRUE)}),
                               Traits = "Ideology"))

diff.frame <- rbind(data.frame(Respondents = 1:dim(persdiff.frame)[2],
                               Difference = apply(persdiff.frame,2,mean,na.rm = TRUE),
                               CI.low = apply(persdiff.frame,2,
                                              function(x){mean(x, na.rm = TRUE) -
                                                                1.645*sd(x, na.rm = TRUE)}),
                               CI.high= apply(persdiff.frame,2,
                                              function(x){mean(x, na.rm = TRUE) +
                                                                1.645*sd(x, na.rm = TRUE)}),
                               Traits = "Personality Traits"), 
                    data.frame(Respondents = 1:dim(ideodiff.frame)[2],
                               Difference = apply(ideodiff.frame,2,mean,na.rm = TRUE),
                               CI.low = apply(ideodiff.frame,2,
                                              function(x){mean(x, na.rm = TRUE) -
                                                                1.645*sd(x, na.rm = TRUE)}),
                               CI.high= apply(ideodiff.frame,2,
                                              function(x){mean(x, na.rm = TRUE) +
                                                                1.645*sd(x, na.rm = TRUE)}),
                               Traits = "Ideology"))

# plotting the correlations over time
corr.plot <- ggplot(corr.frame, aes(x = Respondents,
                                    y = Correlation,
                                    color = Traits,
                                    fill = Traits, 
                                    linetype = Traits)) +
  theme_bw() + 
  geom_ribbon(aes(ymin = CI.low, ymax = CI.high), color = NA, alpha = I(0.4)) +
  geom_line(color = "black") + 
  ylab('Correlation Between Mean 2014 and 2016 Traits\n') +
  xlab('\nMinimum Number of Respondents Per Legislator') + 
  scale_linetype_discrete(name = "Traits") +
  scale_fill_grey(name = "Traits", start = 0, end = 0.8) + 
  scale_colour_grey(name = "Traits", start = 0, end = 0.8) + 
  xlim(0,160)

#plotting the diffeences over time
diff.plot <- ggplot(diff.frame, aes(x = Respondents,
                                    y = Difference,
                                    color = Traits,
                                    fill = Traits, 
                                    linetype = Traits)) +
  theme_bw() + 
  geom_ribbon(aes(ymin = CI.low, ymax = CI.high), color = NA, alpha = I(0.4)) +
  geom_line(color = "black") + 
  ylab('Difference Between Mean 2014 and 2016 Traits\n') +
  xlab('\nMinimum Number of Respondents Per Legislator') +
  scale_linetype_discrete(name = "Traits") +
  scale_fill_grey(name = "Traits", start = 0, end = 0.8) + 
  scale_colour_grey(name = "Traits", start = 0, end = 0.8) + 
  xlim(0,160)

# Figure 2
ggsave(diff.plot, file = "Figure 2.pdf", height = 4, width = 6)

# Figure 1
ggsave(corr.plot, file = "Figure 1.pdf", height = 4, width = 6)



# Comparison with ELUCIDATION
colnames(abvs) <- c("state", "StateAbbr")
cces.rep <- merge(cces14.rep, abvs)
cces.sen1 <- merge(cces14.sen1, abvs)
cces.sen2 <- merge(cces14.sen2, abvs)


# Create function to trim whitespace
trim <- function (x)gsub("^\\s+|\\s+$", "", x)

# Create aggregate personality scores based on average CCES responses


rep.agg <- ddply(subset(cces.rep, 
                        select = c(CurrentHouseName, cong_openn, cong_consc, cong_extra, 
                                   cong_agree, cong_emoti, rep_app2, respondent_AM, cong_AM,
                                   StateAbbr)), 
                 summarise, .variable = .(trim(CurrentHouseName), StateAbbr), 
                 openn = mean(cong_openn, na.rm = TRUE), 
                 consc = mean(cong_consc, na.rm = TRUE), 
                 extra = mean(cong_extra, na.rm = TRUE), 
                 agree = mean(cong_extra, na.rm = TRUE), 
                 emoti = mean(cong_extra, na.rm = TRUE), 
                 number_resp = length(cong_extra),
                 approval = mean(as.numeric(rep_app2), na.rm = TRUE),
                 ideo_dist = mean(abs(respondent_AM - cong_AM), na.rm = TRUE),
                 type = "Representative",
                 state = trim(unique(as.character(StateAbbr))))

sen1.agg <- ddply(subset(cces.sen1, 
                         select = c(CurrentSen1Name, cong_openn, cong_consc, cong_extra, 
                                    cong_agree, cong_emoti, sen1_app2, respondent_AM, cong_AM,
                                    StateAbbr)), 
                  summarise, .variable = .(trim(CurrentSen1Name), StateAbbr), 
                  openn = mean(cong_openn, na.rm = TRUE), 
                  consc = mean(cong_consc, na.rm = TRUE), 
                  extra = mean(cong_extra, na.rm = TRUE), 
                  agree = mean(cong_extra, na.rm = TRUE), 
                  emoti = mean(cong_extra, na.rm = TRUE), 
                  number_resp = length(cong_extra),
                  approval = mean(as.numeric(sen1_app2), na.rm = TRUE),
                  ideo_dist = mean(abs(respondent_AM - cong_AM), na.rm = TRUE),
                  type = "Senator",
                  state = trim(unique(as.character(StateAbbr))))

sen2.agg <- ddply(subset(cces.sen2, 
                         select = c(CurrentSen2Name, cong_openn, cong_consc, cong_extra, 
                                    cong_agree, cong_emoti, sen2_app2, respondent_AM, cong_AM,
                                    StateAbbr)), 
                  summarise, .variable = .(trim(CurrentSen2Name), StateAbbr), 
                  openn = mean(cong_openn, na.rm = TRUE), 
                  consc = mean(cong_consc, na.rm = TRUE), 
                  extra = mean(cong_extra, na.rm = TRUE), 
                  agree = mean(cong_extra, na.rm = TRUE), 
                  emoti = mean(cong_extra, na.rm = TRUE), 
                  number_resp = length(cong_extra),
                  approval = mean(as.numeric(sen2_app2), na.rm = TRUE),
                  ideo_dist = mean(abs(respondent_AM - cong_AM), na.rm = TRUE),
                  type = "Senator",
                  state = trim(unique(as.character(StateAbbr))))

colnames(rep.agg)[1] <- "name"
colnames(sen1.agg)[1] <- "name"
colnames(sen2.agg)[1] <- "name"

CCES_congress_pers <- rbind(rep.agg, sen1.agg, sen2.agg)
CCES_congress_pers$name <- iconv(CCES_congress_pers$name, to='ASCII//TRANSLIT')
CCES_congress_pers <- subset(CCES_congress_pers, name != "")
CCES_congress_pers$lastname <- unlist(lapply(strsplit(gsub(", Jr.|III|IV", "", CCES_congress_pers$name), " "), 
                                             function(x) { return(x[length(x)]) }))
CCES_congress_pers$lastname <- trim(CCES_congress_pers$lastname)


house_elucidate <- read.dta("LifetimeMeansHouse_byCong.dta")
senate_elucidate <- read.dta("LifetimeMeansSenate_byCong.dta")
bios <- read.dta("congressbios.dta")
bios$name <- iconv(bios$name, to='ASCII//TRANSLIT')

bios$name <- gsub("[(][)]|[(]congressman[)]|[(]politician[)]|, Jr.|III|IV", "",  bios$name)
bios$lastname <- unlist(lapply(strsplit(gsub("[(][)]|[(]congressman[)]|[(]politician[)]|, Jr.|III|IV", "", 
                                             bios$name), " "), 
                               function(x) { return(x[length(x)]) }))
bios <- subset(bios, birthyear >= 1914)
bios$name <- trim(bios$name)
bios$lastname <- trim(bios$lastname)
bios$state <- trim(as.character(bios$state))

CCES_congress_pers2 <- merge(CCES_congress_pers, 
                             subset(bios, select = c(name, lastname, icpsr, gender, birthyear, state)), by = "lastname")
CCES_congress_pers2 <- subset(CCES_congress_pers2, state.x == state.y)

nameframe <- NULL
for(i in 1:length(unique(CCES_congress_pers2$lastname))){
  foo <- CCES_congress_pers2[CCES_congress_pers2$lastname == unique(CCES_congress_pers2$lastname)[i],]
  foo$dist <- stringdist(foo$name.x,foo$name.y, method = "jw")
  foo$dist[foo$dist > .25] <- NA
  for(j in 1:length(unique(foo$name.x))){
    foo2 <- foo[which(foo$name.x == unique(foo$name.x)[j]),][which.min(foo[which(foo$name.x == unique(foo$name.x)[j]),]$dist),]
    nameframe <- rbind(nameframe, foo2)
  }
}


colnames(nameframe)[colnames(nameframe) == "name.x"] <- "name"
elucidate <- rbind(house_elucidate, senate_elucidate)
CCES_congress_pers3 <- inner_join(nameframe, subset(bios, select = c(name, icpsr, gender, birthyear)))
CCES_congress_pers4 <- merge(CCES_congress_pers3, elucidate, by = "icpsr")




mod.openn <- lm(scale(openn) ~ scale(lifeOpen) + approval + I(gender == "M") + I(2014 - birthyear), data = CCES_congress_pers4, weights = number_resp)
mod.consc <- lm(scale(consc) ~ scale(lifeConsc) + approval + I(gender == "M") + I(2014 - birthyear), data = CCES_congress_pers4, weights = number_resp)
mod.extra <- lm(scale(extra) ~ scale(lifeExtra) + approval + I(gender == "M") + I(2014 - birthyear), data = CCES_congress_pers4, weights = number_resp)
mod.agree <- lm(scale(agree) ~ scale(lifeAgree) + approval + I(gender == "M") + I(2014 - birthyear), data = CCES_congress_pers4, weights = number_resp)
mod.emoti <- lm(scale(emoti) ~ scale(lifeEmoti) + approval + I(gender == "M") + I(2014 - birthyear), data = CCES_congress_pers4, weights = number_resp)

openn.hyptest <- linearHypothesis(mod.openn, "scale(lifeOpen) = 0")
consc.hyptest <- linearHypothesis(mod.consc, "scale(lifeConsc) = 0")
extra.hyptest <- linearHypothesis(mod.extra, "scale(lifeExtra) = 0")
agree.hyptest <- linearHypothesis(mod.agree, "scale(lifeAgree) = 0")
emoti.hyptest <- linearHypothesis(mod.emoti, "scale(lifeEmoti) = 0")


texreg(list(mod.openn, mod.consc, mod.extra, mod.agree, mod.emoti),
       file = "Table 1.tex",
       stars = c(0.01, 0.05, 0.1),
       digits = 3,
       custom.model.names = c("Openness", "Conscientiousness", "Extraversion", 
                              "Agreeableness", "Emotional Stability"),
       custom.coef.names = c("Constant",
                             "Lifetime Openness",
                             "Aggregate Approval",
                             "Male Legislator",
                             "Legislator Age",
                             "Lifetime Conscientiousness",
                             "Lifetime Extraversion",
                             "Lifetime Agreeableness",
                             "Lifetime Emotional Stability"),
       reorder.coef = c(2,6:9,3:5,1),
       include.fstatistic = TRUE,
       include.rmse = FALSE)